pyarrow.compute.strptime#

pyarrow.compute.strptime(strings,/,format,unit,error_is_null=False,*,options=None,memory_pool=None)#

Parse timestamps.

For each string instrings, parse it as a timestamp.The timestamp unit and the expected string pattern must be givenin StrptimeOptions. Null inputs emit null. If a non-null stringfails parsing, an error is returned by default.

Parameters:
stringsArray-like or scalar-like

Argument to compute function.

formatstr

Pattern for parsing input strings as timestamps, such as “%Y/%m/%d”.Note that the semantics of the format follow the C/C++ strptime, not the Python one.There are differences in behavior, for example how the “%y” placeholderhandles years with less than four digits.

unitstr

Timestamp unit of the output.Accepted values are “s”, “ms”, “us”, “ns”.

error_is_nullbool, defaultFalse

Return null on parsing errors if true or raise if false.

optionspyarrow.compute.StrptimeOptions, optional

Alternative way of passing options.

memory_poolpyarrow.MemoryPool, optional

If not passed, will allocate memory from the default memory pool.