Marco Gorelli - Polars and time zones: everything you need to know

Learn how to effectively handle time zones in data manipulation and analysis using Polars, a Python library, and avoid confusion and mistakes with its various functions, including offset by, groupByDynamic, and replaceTimeZone.

Key takeaways
  • The speaker talks about the necessity of handling time zones in data manipulation and analysis.
  • The Dutch education system is praised for its high standard.
  • Time zones can be tricky to handle due to different offset rules, developer’s dawn, time advances and time goes back.
  • Using Polars, a Python library, to handle time zones can simplify the process.
  • The speaker argues that manually handling time zones can lead to confusion and mistakes, and that Polars can help avoid this.
  • The offset by function in Polars can be used to shift dates and times by a specified number of hours, minutes, or seconds.
  • The groupByDynamic function in Polars can be used to group dates by year, month, day, or week.
  • Time units can be specified in Polars, such as 1D (one calendar day), 24H (24 hours), or microseconds.
  • Converting dates and times to UTC can be useful, but it’s not always necessary.
  • The replaceTimeZone function in Polars can be used to change the time zone of a dataset.
  • Regular expressions can be used to parse date and time strings.
  • The groupBy function in Polars can be used to group dates and times by various intervals.
  • The offset parameter in Polars can be used to specify the offset of a date and time.