'Index' object has no attribute 'tz_localize'

后端 未结 2 1397
小蘑菇
小蘑菇 2021-01-19 05:56

I\'m trying to convert all instances of \'GMT\' time in a time/date column (\'Created_At\') in a csv file so that it is all formatted in \'EST\'. Please see below:



        
2条回答
  •  不要未来只要你来
    2021-01-19 06:18

    Replace

    cambridge.set_index('Created_At', drop=False, inplace=True)
    

    with

    cambridge.set_index(pd.DatetimeIndex(cambridge['Created_At']), drop=False, inplace=True)
    

提交回复
热议问题