pyarrow.compute.week#

pyarrow.compute.week(values,/,*,week_starts_monday=True,count_from_zero=False,first_week_is_fully_in_year=False,options=None,memory_pool=None)#

Extract week of year number.

First week has the majority (4 or more) of its days in January.Year can have 52 or 53 weeks. Week numbering can start with 0 or 1 usingDayOfWeekOptions.count_from_zero.An error is returned if the values have a defined timezone but itcannot be found in the timezone database.

Parameters:
valuesArray-like or scalar-like

Argument to compute function.

week_starts_mondaybool, defaultTrue

If True, weeks start on Monday; if False, on Sunday.

count_from_zerobool, defaultFalse

If True, dates at the start of a year that fall into the last weekof the previous year emit 0.If False, they emit 52 or 53 (the week number of the last weekof the previous year).

first_week_is_fully_in_yearbool, defaultFalse

If True, week number 0 is fully in January.If False, a week that begins on December 29, 30 or 31 is consideredto be week number 0 of the following year.

optionspyarrow.compute.WeekOptions, optional

Alternative way of passing options.

memory_poolpyarrow.MemoryPool, optional

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