Why window functions matter
📖 Scenario: Imagine you work in a sales team. You have daily sales data for a store. You want to see how sales change day by day and understand trends better.
🎯 Goal: You will create a small sales dataset, set a window size, calculate the rolling average sales using a window function, and print the result. This helps smooth out daily ups and downs to see trends.
📋 What You'll Learn
Create a pandas DataFrame with exact sales data
Create a variable for the window size
Use pandas rolling window function to calculate the rolling average
Print the resulting DataFrame with the rolling average column
💡 Why This Matters
🌍 Real World
Rolling averages are used in sales, finance, and weather data to smooth out short-term fluctuations and highlight longer-term trends.
💼 Career
Data analysts and scientists use window functions like rolling averages to prepare data for reports and decision-making.
Progress0 / 4 steps