0

I'm trying to convert my dataframe which looks like:

             ds          y
0    1999-01-04   0.000000
1    1999-01-05   1.330603
2    1999-01-06   4.556447
3    1999-01-07   6.823689
4    1999-01-08   8.949833
...         ...        ...
5377 2020-05-18  34.497940

To a series that looks like

1999-01-04   0.000000
1999-01-05   1.330603
1999-01-06   4.556447
1999-01-07   6.823689
1999-01-08   8.949833
...         ...       
2020-05-18  34.497940

I have looked at: Convert pandas data frame to series (and many others) and I still cannot accomplish the task.

Would appreciate any help.

Space
  • 51
  • 1
  • 10

1 Answers1

3

We can do

s=df.set_index('ds').y
BENY
  • 317,841
  • 20
  • 164
  • 234