-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Clean uses of super, part II #26230
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2025,8 +2025,8 @@ def __unicode__(self): | |
return result | ||
|
||
def __repr__(self): | ||
# We want PandasObject.__repr__, which dispatches to __unicode__ | ||
return super(ExtensionArray, self).__repr__() | ||
# We want to bypass ExtensionArray.__repr__. | ||
return str(self) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This ends up in both master and this PR to call |
||
|
||
def _maybe_coerce_indexer(self, indexer): | ||
""" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6328,10 +6328,9 @@ def aggregate(self, func, axis=0, *args, **kwargs): | |
|
||
def _aggregate(self, arg, axis=0, *args, **kwargs): | ||
if axis == 1: | ||
# NDFrame.aggregate returns a tuple, and we need to transpose | ||
# NDFrame._aggregate returns a tuple, and we need to transpose | ||
# only result | ||
result, how = (super(DataFrame, self.T) | ||
._aggregate(arg, *args, **kwargs)) | ||
result, how = self.T._aggregate(arg, *args, axis=0, **kwargs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is clearer to read than the super version. |
||
result = result.T if result is not None else result | ||
return result, how | ||
return super()._aggregate(arg, *args, **kwargs) | ||
|
@@ -6342,7 +6341,7 @@ def _aggregate(self, arg, axis=0, *args, **kwargs): | |
def transform(self, func, axis=0, *args, **kwargs): | ||
axis = self._get_axis_number(axis) | ||
if axis == 1: | ||
return super(DataFrame, self.T).transform(func, *args, **kwargs).T | ||
return self.T.transform(func, *args, axis=0, **kwargs).T | ||
return super().transform(func, *args, **kwargs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is clearer to read than the |
||
|
||
def apply(self, func, axis=0, broadcast=None, raw=False, reduce=None, | ||
|
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 changes the first parameter in super to implivitly be
TimeStamp
rather than_Timestamp
, which is ok in this case.