-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
ENH: Add numeric_only to resampler methods #46792
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
Conversation
|
can you show the rendered doc-string and point to the current one for comparison |
|
Thanks @jreback. The re-rendered doc-string of
===========================================================================
|
|
cc @rhshadrach |
|
Thanks for the PR @lorentzbao; this is indeed the path forward mentioned in the linked issue. However, I did not realize that we'd want to deprecate the dropping of nuisance columns in resample similar to what we're doing with with Series/DataFrame/groupby. See #46560 for details (especially the two linked issues there). For this, it seems necessary to add Do you think you could add |
Really appreciate your comments @rhshadrach. Let me go through the links you shared. I think I could have a try adding |
|
I should have also mentioned - see #46708 for similar examples where this argument was added to frame methods. |
Thanks @rhshadrach. I have added |
rhshadrach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking real good; I think the only test to add (in addition to request below) would be Series raising if numeric_only=True is passed.
rhshadrach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
ping @jreback |
jreback
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm failures look u related
|
thanks @lorentzbao |
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.After examining the reported issue #46442, I found the issue exists in all the following docs.
https://pandas.pydata.org/docs/reference/api/pandas.core.resample.Resampler.sum.html
https://pandas.pydata.org/docs/reference/api/pandas.core.resample.Resampler.prod.html
https://pandas.pydata.org/docs/reference/api/pandas.core.resample.Resampler.min.html
https://pandas.pydata.org/docs/reference/api/pandas.core.resample.Resampler.max.html
https://pandas.pydata.org/docs/reference/api/pandas.core.resample.Resampler.first.html
https://pandas.pydata.org/docs/reference/api/pandas.core.resample.Resampler.last.html
The problem seems to be caused by the fact that the docstrings of
sum,prod,min,max,first,lastmethodsin the
Resamplerclass borrow the_groupby_agg_method_templatetemplate fromGroupByclass. I think one possible fix iscreating a
_resample_agg_method_templateand using this template to create docstrings for the methods mentioned above.I am a first-time contributor. Appreciate any suggestions and ideas for fixing this issue.