Skip to content

Commit d3f1698

Browse files
authored
Update index.md
1 parent e716fc1 commit d3f1698

File tree

1 file changed

+1
-13
lines changed
  • docs/04_visualizations/2-8-tree-map

1 file changed

+1
-13
lines changed

docs/04_visualizations/2-8-tree-map/index.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,7 @@ sidebar_position: 2.8
2727
### 数据示例
2828

2929
```py
30-
info = query("select product_name, contract_size from public.product_info where futures_type = '期货'")
31-
data = query("select * from derive.f_daily_quotes where day = '2024-12-16'")
32-
33-
product_list = list(info['product_name'])
34-
seldata = data[data['product_name'].apply(lambda x : x in product_list)]
35-
36-
mergedata = data.merge(info, 'inner', 'product_name')
37-
38-
mergedata['market_value'] = mergedata['settlement_price'] * mergedata['open_interest'] * mergedata['contract_size']/100000000
39-
40-
groupdata = mergedata.groupby('product_name').sum(numeric_only = True)
41-
42-
return groupdata
30+
select toDateTime(Time/1000) as Time, Volume * Close as MarketValue, * from klines.spot_1d where Symbol like '%usdt' and Exchange = 'Binance' order by Time desc, MarketValue desc limit 100
4331
```
4432

4533

0 commit comments

Comments
 (0)