Skip to content

REF: extract params used in DataFrame.__repr__ #43987

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 4 commits into from
Oct 14, 2021

Conversation

topper-123
Copy link
Contributor

@topper-123 topper-123 commented Oct 11, 2021

DataFrame.__repr__ used different parameters than DataFrame.to_string and I've got a case where I want to use the __repr__ ones, but with a change to one of the parameters. This refactoring makes it possible to extract those parameters so we can do:

>>> params = pd.io.formats.format.get_frame_repr_params()
>>> params[my_param] = new_value
>>> df.to_string(**params)

@alimcmaster1 alimcmaster1 added Refactor Internal refactoring of code Output-Formatting __repr__ of pandas objects, to_string labels Oct 12, 2021
@alimcmaster1 alimcmaster1 added this to the 1.4 milestone Oct 12, 2021
Copy link
Member

@alimcmaster1 alimcmaster1 left a comment

Choose a reason for hiding this comment

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

LGTM :)

@alimcmaster1 alimcmaster1 merged commit 75be36e into pandas-dev:master Oct 14, 2021
@topper-123 topper-123 deleted the flexible_dataframe._repr branch October 15, 2021 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Output-Formatting __repr__ of pandas objects, to_string Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants