0
0
Data Analysis Pythondata~10 mins

Resampling time series in Data Analysis Python - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to resample the time series data to daily frequency.

Data Analysis Python
daily_data = data.[1]('D').mean()
Drag options to blanks, or click blank then click option'
Asort
Bgroupby
Cpivot
Dresample
Attempts:
3 left
💡 Hint
Common Mistakes
Using groupby instead of resample
Trying to use pivot which is for reshaping data
Using sort which only orders data
2fill in blank
medium

Complete the code to resample the data to monthly frequency and sum the values.

Data Analysis Python
monthly_sum = data.[1]('M').sum()
Drag options to blanks, or click blank then click option'
Aresample
Baggregate
Cfilter
Dgroupby
Attempts:
3 left
💡 Hint
Common Mistakes
Using groupby which does not work directly on time index
Using aggregate without resampling first
3fill in blank
hard

Fix the error in the code to resample data to hourly frequency and take the mean.

Data Analysis Python
hourly_mean = data.[1]('H').mean()
Drag options to blanks, or click blank then click option'
Agroupby
Brolling
Cresample
Dshift
Attempts:
3 left
💡 Hint
Common Mistakes
Using groupby which does not handle time frequency
Using rolling which is for moving averages
4fill in blank
hard

Fill both blanks to create a dictionary of weekly max values for each column in the DataFrame.

Data Analysis Python
weekly_max = {col: data[col].[1]('W').[2]() for col in data.columns}
Drag options to blanks, or click blank then click option'
Aresample
Bgroupby
Cmax
Dmean
Attempts:
3 left
💡 Hint
Common Mistakes
Using groupby instead of resample
Using mean instead of max
5fill in blank
hard

Fill all three blanks to create a dictionary of resampled data with minimum values monthly for each column.

Data Analysis Python
monthly_min = [1]: data[[2]].[3]('M').min() for [1] in data.columns
Drag options to blanks, or click blank then click option'
Acol
Cresample
Dgroupby
Attempts:
3 left
💡 Hint
Common Mistakes
Using groupby instead of resample
Using inconsistent variable names in comprehension