Strip timezone info in pandas

前端 未结 5 1437
一生所求
一生所求 2020-12-09 17:04

I have been struggling with removing the time zone info from a column in a pandas dataframe. I have checked the following question, but it does not work for me:

Can

5条回答
  •  春和景丽
    2020-12-09 17:09

    If your series contains only datetimes, then you can do:

    my_series.dt.tz_localize(None)

    This will remove the timezone information ( it will not change the time) and return a series of naive local times, which can be exported to excel using to_excel() for example.

提交回复
热议问题