0

I would like to change the index of the following dataframe

           Timestamp     Open     High      Low    Close  Volume
2020-09-18  16:12:00  1.07852  1.07852  1.07834  1.07841     111
2020-09-18  16:11:00  1.07843  1.07853  1.07841  1.07851      80
2020-09-18  16:10:00  1.07841  1.07847  1.07841  1.07842      69
2020-09-18  16:09:00  1.07843  1.07848  1.07840  1.07841     243
2020-09-18  16:08:00  1.07850  1.07851  1.07841  1.07843      76

in this new dataframe with a new index like this

                      Open     High      Low    Close  Volume
2020-09-18 16:12:00  1.07852  1.07852  1.07834  1.07841     111
2020-09-18 16:11:00  1.07843  1.07853  1.07841  1.07851      80
2020-09-18 16:10:00  1.07841  1.07847  1.07841  1.07842      69
2020-09-18 16:09:00  1.07843  1.07848  1.07840  1.07841     243
2020-09-18 16:08:00  1.07850  1.07851  1.07841  1.07843      76
Quang Hoang
  • 146,074
  • 10
  • 56
  • 74
  • `df.set_index('Timestamp')`? – Quang Hoang Oct 21 '20 at 16:04
  • Welcome to SO. This isn't a discussion forum or tutorial. Please take the [tour] and take the time to read [ask] and the other links found on that page. [https://pandas.pydata.org/docs/user_guide/index.html](https://pandas.pydata.org/docs/user_guide/index.html) – wwii Oct 21 '20 at 16:08

0 Answers0