Recall & Review
beginner
What is resampling in time series data?
Resampling means changing the frequency of your time series data. You can make data points more spread out (downsampling) or more frequent (upsampling).
Click to reveal answer
beginner
What does
df.resample('M').mean() do in pandas?It groups the data by each month ('M') and calculates the average value for each month.
Click to reveal answer
beginner
What is the difference between downsampling and upsampling?
Downsampling reduces data frequency (e.g., daily to monthly). Upsampling increases frequency (e.g., monthly to daily) and may need filling missing values.
Click to reveal answer
intermediate
Why do we need to use a method like
ffill() or bfill() after upsampling?Because upsampling creates new time points with missing values. Forward fill (
ffill()) or backward fill (bfill()) fills those gaps with nearby data.Click to reveal answer
beginner
What does the string 'W' mean in
df.resample('W')?'W' means resampling the data by week. It groups data into weekly bins.
Click to reveal answer
Which pandas function is used to change the frequency of time series data?
✗ Incorrect
The resample() function changes the frequency of time series data.
What happens when you downsample time series data?
✗ Incorrect
Downsampling reduces the number of data points by grouping them into larger time bins.
After upsampling, which method can fill missing values by copying the last known value forward?
✗ Incorrect
ffill() fills missing values by carrying forward the last valid observation.
What does the frequency string 'D' stand for in pandas resampling?
✗ Incorrect
'D' means daily frequency in pandas resampling.
Which aggregation function would you use to get the total sum after resampling?
✗ Incorrect
sum() adds all values in each resampled group.
Explain how to resample a daily time series to monthly frequency and calculate the average for each month using pandas.
Think about grouping data by month and then averaging.
You got /3 concepts.
Describe the difference between downsampling and upsampling in time series data and why filling missing values is important after upsampling.
Consider what happens to data points when changing frequency.
You got /4 concepts.