pyarrow.compute.week

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

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 using DayOfWeekOptions.count_from_zero. An error is returned if the timestamps have a defined timezone but it cannot be found in the timezone database.

Parameters
  • values (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.WeekOptions, optional) – Parameters altering compute function semantics.

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

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

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