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

Connected

연습 문제

Calculating weekly rental totals

Beyond filtering, you often need to aggregate data by time periods. To spot trends across July and compare week-over-week demand, calculate weekly rental totals.

polars is loaded as pl. The DataFrame bikes is available, sorted by time.

지침

100 XP
  • Group the data by week using group_by_dynamic().
  • Calculate the sum of rentals and name it total_rentals.