In[1212]: x
Out[1213]:
Open 22.551850
High 22.692506
Low 21.989226
Close 22.036111
Total_Volume 7192.000000
Name: 2006-02-07 00:00:00, dtype: float64
如何从上面的变量 x
(即 pd.Series
)获取 2006-02-07 00:00:00
?
我尝试了x.index
,但它返回:
Index([u'Open', u'High', u'Low', u'Close', u'Total_Volume'], dtype='object')
最佳答案
看起来您正在寻找的变量是系列的名称:
x.name
关于python - 获取 Pandas 系列的日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25696663/