【发布时间】:2023-01-03 18:58:08
【问题描述】:
我正在尝试组织我的 pandas 数据框,就像我们从带有 OHLCV 的多个股票代码的雅虎金融数据框获得的数据框一样。如何实现。
我试过。
df = df[['Name','datetime','open','high','low','close','volume']]
df.set_index(['Name', 'datetime'], inplace=True)
df = df.astype(float)
and got the following output.
【问题讨论】:
标签: pandas database dataframe group-by yahoo-api