pyarrow.compute.assume_timezone

pyarrow.compute.assume_timezone(timestamps, *, memory_pool=None, options=None, timezone, ambiguous='raise', nonexistent='raise')

Convert naive timestamp to timezone-aware timestamp.

Input timestamps are assumed to be relative to the timezone given in the timezone option. They are converted to UTC-relative timestamps and the output type has its timezone set to the value of the timezone option. Null values emit null. This function is meant to be used when an external system produces “timezone-naive” timestamps which need to be converted to “timezone-aware” timestamps. An error is returned if the timestamps already have a defined timezone.

Parameters
  • timestamps (Array-like or scalar-like) – Argument to compute function

  • memory_pool (pyarrow.MemoryPool, optional) – If not passed, will allocate memory from the default memory pool.

  • options (pyarrow.compute.AssumeTimezoneOptions, optional) – Parameters altering compute function semantics.

  • timezone (optional) – Parameter for AssumeTimezoneOptions constructor. Either options or timezone can be passed, but not both at the same time.

  • ambiguous (optional) – Parameter for AssumeTimezoneOptions constructor. Either options or ambiguous can be passed, but not both at the same time.

  • nonexistent (optional) – Parameter for AssumeTimezoneOptions constructor. Either options or nonexistent can be passed, but not both at the same time.