我如何显示yfinancedata witout日期
import yfinance as yf
data = yf.download('AAPL')
print(data['Open'].tail(1).to_string())
结果是
Date Open
2022-06-09 36.849998
我想删除任何人可以帮我吗?
import yfinance as yf
data = yf.download('AAPL')
print(data['Open'].tail(1).to_string())
the result is
Date Open
2022-06-09 36.849998
I want to remove the date can anyone help me please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关键是数据将以数据框架返回。如果要提取一个值,请使用方括号中的值来指定索引。由于此数据框中的索引是日期,因此您也可以提取它们,例如:
the point is that the data is returned as a dataframe. If you want to extract a value, then use values in square brackets to specify the index. Since the indexes in this dataframe are dates, you can also extract them, for example: