Skip to content

CLN, TYP: Factor out part of info #34092

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

Merged
merged 6 commits into from
May 11, 2020

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented May 9, 2020

Precursor to #31796, which still has a rather large diff. This should help make it easier to read.

On master, cols holds the DataFrame's columns. If we were to use this method on a Series, then it would hold an Index containing the Series' name (Index([data.name])). Is there a good name for a variable that could store either? At the moment I've called it ids

return str(s)[:space].ljust(space)


def _get_ids_and_dtypes(data: FrameOrSeries) -> Tuple["Index", "Series"]:
Copy link
Contributor

Choose a reason for hiding this comment

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

where is this useful?

Copy link
Member Author

@MarcoGorelli MarcoGorelli May 10, 2020

Choose a reason for hiding this comment

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

@jreback if I rebase #31796 onto this, the diff is a little easier to read as all that needs to change for this part is a

if isinstance(data, Series)

inside this helper function

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, please add a doc-string

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

@MarcoGorelli ok, some comments, ping on green.


def _put_str(s, space):

def _put_str(s: Union[str, Dtype], space: int) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a doc-string

return str(s)[:space].ljust(space)


def _get_ids_and_dtypes(data: FrameOrSeries) -> Tuple["Index", "Series"]:
Copy link
Contributor

Choose a reason for hiding this comment

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

ok, please add a doc-string

@jreback jreback added Clean Dtype Conversions Unexpected or buggy dtype conversions Output-Formatting __repr__ of pandas objects, to_string labels May 10, 2020
@jreback jreback added this to the 1.1 milestone May 10, 2020
@MarcoGorelli
Copy link
Member Author

ping on green.

@jreback ping

@jreback jreback merged commit 9929fca into pandas-dev:master May 11, 2020
@jreback
Copy link
Contributor

jreback commented May 11, 2020

thanks @MarcoGorelli

@MarcoGorelli MarcoGorelli deleted the factor-out-info branch May 17, 2020 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Dtype Conversions Unexpected or buggy dtype conversions Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants