pyarrow.compute.weeks_between#

pyarrow.compute.weeks_between(start, end, /, *, count_from_zero=True, week_start=1, options=None, memory_pool=None)#

Compute the number of weeks between two timestamps.

Returns the number of week boundaries crossed from start to end. That is, the difference is calculated as if the timestamps were truncated to the week. Null values emit null.

Parameters
startArray-like or scalar-like

Argument to compute function.

endArray-like or scalar-like

Argument to compute function.

count_from_zerobool, default True

If True, number days from 0, otherwise from 1.

week_startint, default 1

Which day does the week start with (Monday=1, Sunday=7). How this value is numbered is unaffected by count_from_zero.

optionspyarrow.compute.DayOfWeekOptions, optional

Alternative way of passing options.

memory_poolpyarrow.MemoryPool, optional

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