convert index to column pandas dataframe

后端 未结 1 1991
温柔的废话
温柔的废话 2020-12-03 18:17

I have following pandas dataframe:

                    |     id    |  LocTime        |ZPos   | XPos
datetime            |               
2017-01-02 00:14:39          


        
相关标签:
1条回答
  • 2020-12-03 18:44

    Need assign output back or inplace=True parameter:

    df = df.reset_index()
    

    df.reset_index(inplace=True)
    

    print (df)
                  datetime           id         LocalTime  ZPosition  XPosition
    0  2017-01-02 00:14:39  10453190861  1483312478909238          0         -9
    1  2017-01-02 00:14:40  10453191020  1483312479673076          0         -8
    
    0 讨论(0)
提交回复
热议问题