0

I have a Python dictionary and I created a panda data frame like below:

enter image description here

I want to change the name of index column to date . But I couldn't do this with data.set_index('date') . How can I do this? Any advice would be appreciated.

TheNone
  • 5,684
  • 13
  • 57
  • 98

1 Answers1

0

data.set_index('date') here only assign the column with name 'date' as index for the dataframe data.

You can rewrite the name of the column using data.index.name = 'data'