Compatibility with Pandas 0.23.x
Closed this issue · 3 comments
npezolano commented
There is no longer a pd.expanding_max
or pd.expanding_min
function, there's a few ways to get around this or support both.
One way using pandas 0.23.x
expanding_window = pd.core.window.expanding(pd.Series(np.cumsum(x)), min_periods=1)
rolling_max = expanding_window.max().values
rolling_min = expanding_window.min().values
Another numpy only solution:
https://stackoverflow.com/questions/6811183/rolling-window-for-1d-arrays-in-numpy
amirsani commented
Hi Nicholas,
Thanks for providing a solution. Send me a pull request and I'll merge it. Otherwise just let me know and I'll make the changes later today.
Best,
Amir
amirsani commented
Just made the change. I'll test it later today, but it looks good.
Thanks again,
Amir
npezolano commented
Thanks I updated the requirements.txt file as well now