8000 BUG: AttributeError in pandas.core.algorithms.diff when passing non-numeric types by akshat62 · Pull Request #61729 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: AttributeError in pandas.core.algorithms.diff when passing non-numeric types #61729

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

Closed

Conversation

akshat62
Copy link
@akshat62 akshat62 commented Jun 28, 2025

…g non-numeric types

@@ -1334,9 +1334,15 @@ def diff(arr, n: int, axis: AxisInt = 0):
# added a check on the integer value of period
# see https://github.com/pandas-dev/pandas/issues/56607
if not lib.is_integer(n):
if not (is_float(n) and n.is_integer()):
Copy link
Member

Choose a reason for hiding this comment

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

i dont understand how this happens. n.is_integer should only be called when is_float(n), which should be equivalent to isinstance(n, (float, np.float_). so the method should always exist

@mroeschke
Copy link
Member

Thanks for this PR but closing per #61728 (comment)

@mroeschke mroeschke closed this Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: AttributeError in pandas.core.algorithms.diff when passing non-numeric types
3 participants
0