I struggled with deleting timezone information from a column in the pandas framework. I checked the following question, but for me this does not work:
Is it possible to export pandas DataFrame to Excel to remove tzinfo?
I used tz_localize to assign a time zone to a datetime object, because I need to convert to a different time zone using tz_convert. This adds the UTC offset, in the order of "-06: 00". I need to get rid of this bias because it leads to an error when trying to export a DataFrame to Excel.
Actual output
2015-12-01 00:00:00-06:00
Required conclusion
2015-12-01 00:00:00
I tried to get the characters that I want to use with the str () method, but it seems the result of tz_localize is not a string. My solution so far is to export the dataframe to csv, read the file, and use the str () method to get the characters I want.
Is there an easier solution?
source share