1. 학습
  2. /
  3. 강의
  4. /
  5. Data Transformation with Polars

Connected

연습 문제

Calculating the hourly total with window functions

Continuing with the London bike-sharing data, you want to spot unusual demand patterns like events or disruptions. To do this, compare each hour's rentals to its typical total across all days. Window functions let you add group statistics while keeping every row intact.

polars is loaded as pl. The DataFrame bikes is available with columns time, rentals, temp, and hour.

지침

100 XP
  • Calculate the sum of rentals grouped by hour and name the column hourly_total.