Skip to content

Conversation

mroeschke
Copy link
Member

Minor, but avoid a call to np.array when we can use np.full or reshape or an existing op.

@mroeschke mroeschke added the Refactor Internal refactoring of code label Aug 30, 2024
@mroeschke mroeschke added this to the 3.0 milestone Aug 30, 2024
# and incorrectly return an empty array if not caught.
try:
values = np.arange(b, e, stride, dtype=np.int64)
except FloatingPointError:
Copy link
Member

Choose a reason for hiding this comment

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

Do we have coverage here?

Copy link
Member Author

@mroeschke mroeschke Aug 31, 2024

Choose a reason for hiding this comment

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

I'm assuming there's coverage in the tests added in #33498 where this prior code was added

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

lgtm

@rhshadrach rhshadrach merged commit e07453e into pandas-dev:main Sep 2, 2024
50 of 51 checks passed
@rhshadrach
Copy link
Member

Thanks @mroeschke

@mroeschke mroeschke deleted the ref/numpy/ops branch September 2, 2024 17:02
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