Some organizations operate internationally; therefore, the information they collect about events may be recorded together with the time zone of the area where the event took place. To be able to compare events that occurred across different time zones, we first need to set all of the variables within the same zone. In this recipe, we will learn how to unify the time zones of a datetime variable and then learn how to reassign a variable to a different time zone using pandas.Â
Working with time in different time zones
How to do it...
To proceed with the recipe, let's import pandas and then create a toy dataframe with two variables, each one containing a date and time in different time zones:
- Import pandas:
import...