user1234440
user1234440

Reputation: 23587

get date of series Pandas

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

How do I get 2006-02-07 00:00:00 from the above variable x which is a pd.Series?

I tried x.index, but it returns:

Index([u'Open', u'High', u'Low', u'Close', u'Total_Volume'], dtype='object')

Upvotes: 1

Views: 60

Answers (1)

It looks like the variable you are looking for is the name of the Series:

x.name

Upvotes: 3

Related Questions