-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: make Info and DataFrameInfo subclasses #34743
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
# Column Non-Null Count Dtype | ||
# Column Non-Null Count Dtype | ||
--- ------ -------------- ----- | ||
0 int_col 5 non-null int64 | ||
1 text_col 5 non-null object | ||
2 float_col 5 non-null float64 |
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.
I'd accidentally introduced these extra whitespaces when I indented the docstrings as part of a previous PR, and so am fixing them now
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.
looks pretty good
memory_usage: Optional[Union[bool, str]] = None, | ||
null_counts: Optional[bool] = None, | ||
): | ||
if buf is None: # pragma: no cover |
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.
why do you need the pragma here?
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.
Noticed this is in the current implementation. Not sure of reasoning but yea probably safe to remove
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.
Yes, it was from the current implementation - have removed
pandas/io/formats/info.py
Outdated
show_counts = self.null_counts | ||
exceeds_info_cols = col_count > max_cols | ||
|
||
def _sizeof_fmt(num, size_qualifier): |
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.
move this to a module level function
pandas/io/formats/info.py
Outdated
for system-level memory consumption, and include it in the returned | ||
values. | ||
|
||
Returns |
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 can put all of the doc-strings on the base class
looks good can you merge master and ping on green. |
Thanks @jreback - green now |
Friendly ping 😄 (sorry to do this, but I can submit a PR for |
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.
lgtm @jreback
thanks @MarcoGorelli very nice |
precursor to #31796
Makes Info class and DataFrameInfo subclass so there's no need for all the