pyarrow.compute.assume_timezone#
- pyarrow.compute.assume_timezone(timestamps, /, timezone, *, ambiguous='raise', nonexistent='raise', options=None, memory_pool=None)#
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:
- timestampsArray-like or scalar-like
Argument to compute function.
- timezone
str Timezone to assume for the input.
- ambiguous
str, default âraiseâ How to handle timestamps that are ambiguous in the assumed timezone. Accepted values are âraiseâ, âearliestâ, âlatestâ.
- nonexistent
str, default âraiseâ How to handle timestamps that donât exist in the assumed timezone. Accepted values are âraiseâ, âearliestâ, âlatestâ.
- options
pyarrow.compute.AssumeTimezoneOptions, optional Alternative way of passing options.
- memory_pool
pyarrow.MemoryPool, optional If not passed, will allocate memory from the default memory pool.