-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: df.diff axis=1 mixed dtypes #36710
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would need a note in whatsnew, maybe a sub-section as this is a non-trivial change (good change), but should be made aware.
# TODO(EA2D): doing this in a loop unnecessary with 2D EAs | ||
# Define filler inside loop so we get a copy | ||
filler = self.iloc[:, 0].shift(len(self)) | ||
result.insert(0, col, filler, allow_duplicates=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aren't these inplace? do we really want that? (or does .iloc do an implict copy the way you have it), i don't remember exactly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is inplace on result
which we havent returned to the user yet
@@ -7248,12 +7276,15 @@ def melt( | |||
), | |||
) | |||
def diff(self, periods: int = 1, axis: Axis = 0) -> DataFrame: | |||
if not isinstance(periods, int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use is_integer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff