1. Learn
  2. /
  3. Courses
  4. /
  5. Machine Learning for Time Series Data in Python

Exercise

Percentiles and partial functions

In this exercise, you'll practice how to pre-choose arguments of a function so that you can pre-configure how it runs. You'll use this to calculate several percentiles of your data using the same percentile() function in numpy.

Instructions

100 XP
  • Import partial from functools.
  • Use the partial() function to create several feature generators that calculate percentiles of your data using a list comprehension.
  • Using the rolling window (prices_perc_rolling) we defined for you, calculate the quantiles using percentile_functions.
  • Visualize the results using the code given to you.