【问题标题】:Is there any way to call just the Date using yfinance? [duplicate]有没有办法使用 yfinance 只调用日期? [复制]
【发布时间】:2021-07-01 01:45:15
【问题描述】:

我可以调用除日期之外的所有其他列,例如“关闭”、“高”、“低”等。 我曾尝试使用 pandas 数据框,但即便如此我也没有得到想要的结果。

【问题讨论】:

  • df['Date'] 不起作用?请显示带有失败命令的数据框示例。

标签: python python-3.x pandas dataframe yfinance


【解决方案1】:

Date 被加载为索引,因此您可以调用索引:

df.index

reset the index 之前调用df['Date']

df = df.reset_index()
df['Date']

【讨论】:

    猜你喜欢
    • 2019-08-16
    • 1970-01-01
    • 1970-01-01
    • 2022-01-24
    • 1970-01-01
    • 2019-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多