Skip to content

Min max sparse fillna #41691

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

Merged
merged 30 commits into from
Jun 2, 2021
Merged

Min max sparse fillna #41691

merged 30 commits into from
Jun 2, 2021

Conversation

taytzehao
Copy link
Contributor

@taytzehao taytzehao marked this pull request as draft May 27, 2021 17:18
Copy link
Member

@mzeitlin11 mzeitlin11 left a comment

Choose a reason for hiding this comment

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

Thanks for the pr @taytzehao! Couple quick comments

@@ -1326,6 +1326,8 @@ class TestMinMax:
data_neg = plain_data * (-1)
data_NaN = SparseArray(np.array([0, 1, 2, np.nan, 4]))
data_all_NaN = SparseArray(np.array([np.nan, np.nan, np.nan, np.nan, np.nan]))
data_NA_filled = SparseArray(np.array([np.nan, np.nan, np.nan, np.nan, np.nan]))
data_NA_filled.fill_value = 5
Copy link
Member

Choose a reason for hiding this comment

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

Can you just pass fill_value in the constructor instead?

@@ -1081,6 +1081,7 @@ Sparse
- Bug in :meth:`DataFrame.sparse.to_coo` raising ``KeyError`` with columns that are a numeric :class:`Index` without a 0 (:issue:`18414`)
- Bug in :meth:`SparseArray.astype` with ``copy=False`` producing incorrect results when going from integer dtype to floating dtype (:issue:`34456`)
- Implemented :meth:`SparseArray.max` and :meth:`SparseArray.min` (:issue:`40921`)
- Return ``fill_value`` for :meth:`SparseArray.max` and :meth:`SparseArray.min` (:issue:`41552`)
Copy link
Member

Choose a reason for hiding this comment

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

Think this whatsnew is not needed since min/max was never released with this issue

@mzeitlin11 mzeitlin11 added Bug Reduction Operations sum, mean, min, max, etc. Sparse Sparse Data Type labels May 27, 2021
@taytzehao
Copy link
Contributor Author

I am not quite sure what this test failure is pointing towards. It is the same exact failure with my other pull request #41162

@taytzehao taytzehao marked this pull request as ready for review May 28, 2021 06:12
@taytzehao
Copy link
Contributor Author

@jbrockmendel , do I need to change any configuration in order for it to pass? Cause I am not sure why is it so

@jbrockmendel
Copy link
Member

do I need to change any configuration in order for it to pass? Cause I am not sure why is it so

no, this looks like the CI being flaky for unrelated reasons. you can ignore it

@jreback jreback added this to the 1.3 milestone Jun 2, 2021
@jreback jreback merged commit f1c886d into pandas-dev:master Jun 2, 2021
@jreback
Copy link
Contributor

jreback commented Jun 2, 2021

thanks @taytzehao

JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reduction Operations sum, mean, min, max, etc. Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: self.fill_value ignored in SparseArray.min/max
4 participants