I have a pandas series that looks like this:
>>> myseries
2012-01-01 15:20:00-05:00 2
2012-01-01 15:30:00-05:00 1
2012-01-01 15:40:00-05:00 0
...
And I try to put it into a dataframe as so:
>>> mydf = pd.DataFrame(myseries, columns=["myseries"], index = myseries.index)
and all the values become NaN for some reason:
>>> mydf
2012-01-01 15:20:00-05:00 NaN
2012-01-01 15:30:00-05:00 NaN
2012-01-01 15:40:00-05:00 NaN
I'm pretty confused. This seems like a really simple application. What am I doing wrong? By the way, replacing with pd.DataFrame(myseries.values, columns=...)
fixes the problem, but why is it necessary? Thank you.