I am using pandas with version 0.23.4 and the below code is giving me the error - "module 'pandas' has no attribute 'rolling_apply'"
Below is the function call:
df['perLow'] = pd.rolling_apply(df.low, 2, add_percentage_diff)
Any help with fixing this error is much appreciated.
The pd.rolling_*
family of functions were replaced by Rolling
objects associated with DataFrames around v0.18.
Use Rolling.apply
:
df['low'].rolling(2).apply(add_percentage_diff)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With