How to remove the timezone of a date
Land Your First Data Science Job
A proven roadmap to prepare for $75K+ entry-level data roles. Perfect for Data Scientist ready to level up their career.
You might end up in a situation in which you cannot merge two Dataframes because of a timezone issue on dates.
Here is how to remove the timezone with .replace().
# we only import Timestamp for the example
from pandas import Timestamp
# Here we remove the timezone to the date
Timestamp('2022-01-20 11:49:03.377000+0000', tz='UTC').replace(tzinfo=None)
Here you are! You now know how to remove the timezone to a date.
More on fundamentals
If you want to know more about Python fundamentals without headaches... check out the other articles I wrote by clicking just here:
Land Your First Data Science Job
A proven roadmap to prepare for $75K+ entry-level data roles. Perfect for Data Scientist ready to level up their career.
Related Articles
Continue your learning journey with these related topics
Master Data Science in Days, Not Months 🚀
Skip the theoretical rabbit holes. Get practical data science skills delivered in bite-sized lessons – Approach used by real data scientist. Not bookworms. 📚