Skip to content
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

REF: handle axis=None case inside DataFrame.any/all to simplify _reduce #35899

Merged
merged 18 commits into from
Sep 2, 2020

Conversation

jbrockmendel
Copy link
Member

Between this, #35881, and the PR coming after 35881, we'll be able to simplify _reduce quite a bit.


def func(values):
if is_extension_array_dtype(values.dtype):
return extract_array(values)._reduce(name, skipna=skipna, **kwds)
else:
return op(values, axis=axis, skipna=skipna, **kwds)

def _get_data(axis_matters):
def _get_data(axis_matters: bool):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're here could we type that it returns a DataFrame?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@jbrockmendel
Copy link
Member Author

@jreback gentle ping; long-awaited cleanups to DataFrame._reduce come after this

@jreback jreback added this to the 1.2 milestone Sep 2, 2020
@jreback jreback merged commit 075ed8b into pandas-dev:master Sep 2, 2020
@jbrockmendel jbrockmendel deleted the ref-anyall-axis branch September 2, 2020 02:30
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
…ce (pandas-dev#35899)

* REF: remove unnecesary try/except

* TST: add test for agg on ordered categorical cols (pandas-dev#35630)

* TST: resample does not yield empty groups (pandas-dev#10603) (pandas-dev#35799)

* revert accidental rebase

* REF: handle axis=None cases inside DataFrame.all/any

* annotate

* dummy commit to force Travis

Co-authored-by: Karthik Mathur <22126205+mathurk1@users.noreply.github.com>
Co-authored-by: tkmz-n <60312218+tkmz-n@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants