Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Rolling | Time Series Essentials
Time Series Essentials
course content

Зміст курсу

Time Series Essentials

bookRolling

The rolling method in Python is used to create a rolling window of a certain size on a time series or other data. It takes one or more parameters: the window size, and optionally the type of window (e.g. boxcar, hamming, etc.). It returns a new object that behaves like a moving window on the original data. You can then perform various operations on this windowed data, such as calculating the mean, sum, or standard deviation.

Methods description

  • rolling(window): This method creates a Rolling object that represents a rolling window calculation over the DataFrame. The window parameter specifies the size of the rolling window;

  • mean(): This method calculates the mean value over the rolling window. It returns a new DataFrame containing the rolling mean values;

  • print(df): This function prints the rolling mean DataFrame to the console.

Завдання
test

Swipe to show code editor

  1. Create a rolling window of size 3.
  2. Calculate the rolling_mean.
  3. Print the variable.

Mark tasks as Completed
Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

The rolling method in Python is used to create a rolling window of a certain size on a time series or other data. It takes one or more parameters: the window size, and optionally the type of window (e.g. boxcar, hamming, etc.). It returns a new object that behaves like a moving window on the original data. You can then perform various operations on this windowed data, such as calculating the mean, sum, or standard deviation.

Methods description

  • rolling(window): This method creates a Rolling object that represents a rolling window calculation over the DataFrame. The window parameter specifies the size of the rolling window;

  • mean(): This method calculates the mean value over the rolling window. It returns a new DataFrame containing the rolling mean values;

  • print(df): This function prints the rolling mean DataFrame to the console.

Завдання
test

Swipe to show code editor

  1. Create a rolling window of size 3.
  2. Calculate the rolling_mean.
  3. Print the variable.

Mark tasks as Completed
Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 1. Розділ 7
AVAILABLE TO ULTIMATE ONLY
We're sorry to hear that something went wrong. What happened?
some-alt