Skip to content

Commit c06c786

Browse files
authored
Update index.md
1 parent 3ebc0a6 commit c06c786

File tree

1 file changed

+7
-8
lines changed
  • docs/04_visualizations/3-3-donuts

1 file changed

+7
-8
lines changed

docs/04_visualizations/3-3-donuts/index.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ sidebar_position: 3.3
1919
### 数据示例
2020

2121
```py
22-
data = query("select * from derive.f_daily_quotes where day = '2024-12-17' ")
23-
info = query("select product_name, contract_size from public.product_info where futures_type = '期货'")
24-
25-
mergeda = data.merge(info,'left','product_name')
26-
mergeda['volume_value'] = mergeda['settlement_price'] * mergeda['contract_size'] * mergeda['volume']
27-
groupda = mergeda.groupby('product_name').sum(numeric_only=True)
28-
groupda = groupda.sort_values('volume_value')
29-
return groupda
22+
# 创建 DataFrame
23+
data = {
24+
"Coin": ["BTC", "ETH", "SOL", "DOGE", "LTC"],
25+
"MarketValue": [100, 30, 70, 20, 100]
26+
}
27+
28+
return data
3029
```
3130

3231

0 commit comments

Comments
 (0)