Skip to content

Conversation

@jbrockmendel
Copy link
Member

Also avoids some memory allocations which is nice.

def is_float_or_complex(self):
return not (self.bool_ or self.datetime_ or self.timedelta_
or self.nat_)
# i.e. not (anything but bool)
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice if this was def anything_but_bool as it's odd that self.bool_ = False would still return True. Maybe a followup

@mroeschke mroeschke added this to the 2.0 milestone Nov 8, 2022
@mroeschke mroeschke added the Refactor Internal refactoring of code label Nov 8, 2022
@mroeschke mroeschke merged commit 4117f98 into pandas-dev:main Nov 8, 2022
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the ref-maybe_convert_objects-2 branch November 8, 2022 23:46
phofl pushed a commit to phofl/pandas that referenced this pull request Nov 9, 2022
@lukemanley
Copy link
Member

I think this may have caused a slowdown here: https://asv-runner.github.io/asv-collection/pandas/#reshape.Explode.time_explode

@jbrockmendel
Copy link
Member Author

what do you think the culprit is?

@lukemanley
Copy link
Member

actually, looks to be #49566 - and there is some discussion there about adding a fix for the perf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Internal refactoring of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants