pandas使用[]单中括号和[[]]双中括号的区别

pandas使用[]单中括号和[[]]双中括号的区别,第1张

close_px = pd.read_csv(u'https://gitee.com/pan19/data-source/raw/master/stock_px_2.csv', parse_dates=True,
                       index_col=0)
close_px.info()
close_px.head(10)
type(close_px[‘SPX’]) 返回 pandas.core.series.Series type(close_px[[‘SPX’]]) 返回 pandas.core.frame.DataFrame

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/868442.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-13
下一篇 2022-05-13

发表评论

登录后才能评论

评论列表(0条)

保存