-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Deprecate Index.summary (GH18217) #20028
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 3 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 |
---|---|---|
|
@@ -1385,7 +1385,19 @@ def _has_complex_internals(self): | |
# to disable groupby tricks in MultiIndex | ||
return False | ||
|
||
def summary(self, name=None): | ||
def _summary(self, name=None): | ||
""" | ||
Return a summarized representation | ||
|
||
Parameters | ||
---------- | ||
name : str | ||
name to use in the summary representation | ||
|
||
Returns | ||
------- | ||
String with a summarized representation of the index | ||
""" | ||
if len(self) > 0: | ||
head = self[0] | ||
if (hasattr(head, 'format') and | ||
|
@@ -1404,6 +1416,16 @@ def summary(self, name=None): | |
name = type(self).__name__ | ||
return '%s: %s entries%s' % (name, len(self), index_summary) | ||
|
||
def summary(self, name=None): | ||
""" | ||
Return a summarized representation | ||
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. can you add a Parameters & Returns section |
||
.. deprecated:: 0.23.0 | ||
No longer supported | ||
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. you don't need the 'No longer supported' 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. @jreback - This has been removed per your request. Update has been pushed. |
||
""" | ||
warnings.warn("'summary' is deprecated and will be removed in a " | ||
"future version.", FutureWarning, stacklevel=2) | ||
return self._summary(name) | ||
|
||
def _mpl_repr(self): | ||
# how to represent ourselves to matplotlib | ||
return self.values | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1049,9 +1049,18 @@ def where(self, cond, other=None): | |
return self._shallow_copy(result, | ||
**self._get_attributes_dict()) | ||
|
||
def summary(self, name=None): | ||
def _summary(self, name=None): | ||
""" | ||
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. can you update the doc-strings here (and in the base class) 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. @jreback - What specific updates were you referring to? Do the sphinx tags need to be added here? 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. don't need deprecated in the _summary doc-strings |
||
return a summarized representation | ||
Return a summarized representation | ||
|
||
Parameters | ||
---------- | ||
name : str | ||
name to use in the summary representation | ||
|
||
Returns | ||
------- | ||
String with a summarized representation of the index | ||
""" | ||
formatter = self._formatter_func | ||
if len(self) > 0: | ||
|
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.
you don't need a deprecated tag on the
_summary
methods