Function calculate_rate_of_change

Source
pub fn calculate_rate_of_change(
    df: &DataFrame,
    column_name: &str,
    period: usize,
) -> PolarsResult<Series>
Expand description

Calculate the rate of change (ROC) of a column in a DataFrame

§Arguments

  • df - DataFrame containing the column
  • column_name - Name of the column to calculate ROC for
  • period - Period for the ROC calculation

§Returns

Returns a PolarsResult containing the ROC Series