We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In pandas.Series.rolling, the SciPy window type exponential has not been implemented. This win_type would be extremely useful for analysing biological processes. It should be pretty easy to add.
pandas.Series.rolling
exponential
win_type
Please, note that despite the similar name, the proposed method is mathematically different from the implemented pandas.Series.ewm method.
pandas.Series.ewm
Taking for example df.rolling(51, win_type='exponential', tau=10), the implemented SciPy window would be the following asymmetrical window:
df.rolling(51, win_type='exponential', tau=10)
from scipy import signal window = 51 tau = 10 w = signal.exponential(window, tau=tau, sym=False, center=0) array([1. , 0.90483742, 0.81873075, 0.74081822, 0.67032005, 0.60653066, 0.54881164, 0.4965853 , 0.44932896, 0.40656966, 0.36787944, 0.33287108, 0.30119421, 0.27253179, 0.24659696, 0.22313016, 0.20189652, 0.18268352, 0.16529889, 0.14956862, 0.13533528, 0.12245643, 0.11080316, 0.10025884, 0.09071795, 0.082085 , 0.07427358, 0.06720551, 0.06081006, 0.05502322, 0.04978707, 0.0450492 , 0.0407622 , 0.03688317, 0.03337327, 0.03019738, 0.02732372, 0.02472353, 0.02237077, 0.02024191, 0.01831564, 0.01657268, 0.01499558, 0.01356856, 0.01227734, 0.011109 , 0.01005184, 0.00909528, 0.00822975, 0.00744658, 0.00673795])
>>> df = pd.DataFrame({'B': [1, 0, 0, 0, 0]}) >>> df.rolling(51, win_type='exponential', tau=10) B 0 1.0 1 0.90483742 2 0.81873075 3 0.74081822 4 0.67032005
The text was updated successfully, but these errors were encountered:
we already support scipy types so this would be very easy to add - a pull request would make this happen http://pandas.pydata.org/pandas-docs/stable/computation.html#rolling-windows
Sorry, something went wrong.
As far as I can see, only these files need to be amended:
pandas/pandas/core/window.py
pandas/pandas/tests/test_window.py
pandas/doc/source/computation.rst
Successfully merging a pull request may close this issue.
Problem Description
In
pandas.Series.rolling
, the SciPy window typeexponential
has not been implemented. Thiswin_type
would be extremely useful for analysing biological processes. It should be pretty easy to add.Please, note that despite the similar name, the proposed method is mathematically different from the implemented
pandas.Series.ewm
method.Enhancement Request
Taking for example
df.rolling(51, win_type='exponential', tau=10)
, the implemented SciPy window would be the following asymmetrical window:Expected Output
The text was updated successfully, but these errors were encountered: