-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Apply not available for all windows type #28369
New issue
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
Comments
Thanks for the report. If you'd like to investigate and try a PR would certainly be welcome. Relevant code is in pandas.core.window.rolling.py |
Interested to work on this issue, any helpful pointers to begin with |
@WillAyd I'd like to be assigned this issue. According to the following code, when I tried removing the condition so as to always return a Lines 10725 to 10758 in 88a6ee1
|
Great! We don’t really use the assign tool on Github but feel free to take a look and if you can get it to work would certainly welcome a PR
…Sent from my iPhone
On Oct 3, 2019, at 5:46 PM, Rohit Sanjay ***@***.***> wrote:
@WillAyd I'd like to be assigned this issue. According to the following code, when win_type is passed to the rolling function, it returns an object of Window class. The Window class, as opposed to the Rolling class does not have the following functions: ['std', 'var', 'cov', 'kurt', 'quantile', '_validate_freq', 'skew', 'max', '_validate_monotonic', 'apply', '_agg_doc', 'corr', 'count', 'median', 'min'] - which includes apply
I tried removing the condition and always returning a Rolling object, but I encountered issues in other dependent functions.
https://github.com/pandas-dev/pandas/blob/88a6ee1eb1702e31e74d0bdaeae4b70568d07149/pandas/core/generic.py#L10725-L10758
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thanks for the report. This issue is a duplicate of #19286 |
Code Sample, a copy-pastable example if possible
Problem description
The above produces an error, stating that the
Window
class produces by the rolling function does not have anapply
attribute.If I remove the
win_type
attribute, the computation goes fine and returns a result:Expected Output
I expect the
apply
attribute to be available to anywin_type
(I did not see any restrictions in the documentation ofpd.DataFrame.rolling
(https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.rolling.html), or the documentation ofpd.DataFrame.rolling.apply
(https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.window.Rolling.apply.html))Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.6.8.final.0
python-bits : 64
OS : Windows
OS-release : 7
machine : AMD64
processor : Intel64 Family 6 Model 78 Stepping 3, GenuineIntel
byteorder : little
LC_ALL : None
LANG : fr_FR.UTF-8
LOCALE : None.None
pandas : 0.25.1
numpy : 1.16.2
pytz : 2018.9
dateutil : 2.8.0
pip : 19.1.1
setuptools : 40.8.0
Cython : 0.29.6
pytest : 4.3.1
hypothesis : None
sphinx : 1.8.5
blosc : None
feather : None
xlsxwriter : 1.1.5
lxml.etree : 4.3.2
html5lib : 1.0.1
pymysql : None
psycopg2 : None
jinja2 : 2.10
IPython : 7.4.0
pandas_datareader: None
bs4 : 4.7.1
bottleneck : 1.2.1
fastparquet : None
gcsfs : None
lxml.etree : 4.3.2
matplotlib : 3.0.3
numexpr : 2.6.9
odfpy : None
openpyxl : 2.6.1
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : 1.2.1
sqlalchemy : 1.3.1
tables : 3.5.1
xarray : None
xlrd : 1.2.0
xlwt : 1.3.0
xlsxwriter : 1.1.5
The text was updated successfully, but these errors were encountered: