Seasonal averaging estimates the typical value at each position of a repeating cycle. Position p contains the observations at indices p, p + period, p + 2 * period, and so on.
For every position from 0 through period - 1, average all observations belonging to that position. Return the period seasonal averages in position order.
Input: series = [1, 2, 3, 4, 5, 6], period = 3
Output: [2.5, 3.5, 4.5]
Explanation: Seasonal position 0 contains 1 and 4, position 1 contains 2 and 5, and position 2 contains 3 and 6.
Input: series = [1, 2, 1, 2, 1, 2], period = 2
Output: [1.0, 2.0]
For position p, iterate with range(p, len(series), period).
Average each collected seasonal group independently.
Sign in to take notes on this problem
Accepts: array
Accepts: number
Seasonal averaging estimates the typical value at each position of a repeating cycle. Position p contains the observations at indices p, p + period, p + 2 * period, and so on.
For every position from 0 through period - 1, average all observations belonging to that position. Return the period seasonal averages in position order.
Input: series = [1, 2, 3, 4, 5, 6], period = 3
Output: [2.5, 3.5, 4.5]
Explanation: Seasonal position 0 contains 1 and 4, position 1 contains 2 and 5, and position 2 contains 3 and 6.
Input: series = [1, 2, 1, 2, 1, 2], period = 2
Output: [1.0, 2.0]
For position p, iterate with range(p, len(series), period).
Average each collected seasonal group independently.
Sign in to take notes on this problem
Accepts: array
Accepts: number