Skip to content

REF: Use numpy methods instead of np.array #59672

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 1 commit into from
Sep 2, 2024

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