Skip to content

BUG: Summing a sparse boolean series raises TypeError #34220

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 4 commits into from
May 18, 2020

Conversation

simonjayhawkins
Copy link
Member

@@ -1220,7 +1220,7 @@ def any(self, axis=0, *args, **kwargs):

return values.any().item()

def sum(self, axis=0, *args, **kwargs):
def sum(self, axis=0, min_count=0, *args, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add to the doc-string

Copy link
Contributor

Choose a reason for hiding this comment

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

and type args if you can

sp_sum = valid_vals.sum()
if self._null_fill_value:
if count < min_count:
Copy link
Contributor

Choose a reason for hiding this comment

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

can you use array_ops/check_below_min_count

@jreback jreback added this to the 1.1 milestone May 18, 2020
@jreback jreback merged commit e71052c into pandas-dev:master May 18, 2020
@jreback
Copy link
Contributor

jreback commented May 18, 2020

thanks!

@simonjayhawkins simonjayhawkins deleted the sparsearray-sum branch May 18, 2020 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Sparse Sparse Data Type
Projects
None yet
2 participants