Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DEPR: Index.format #55439

Merged
merged 8 commits into from
Oct 13, 2023
Merged

DEPR: Index.format #55439

merged 8 commits into from
Oct 13, 2023

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel requested a review from attack68 as a code owner October 7, 2023 16:29
@mroeschke mroeschke added Output-Formatting __repr__ of pandas objects, to_string Deprecate Functionality to remove in pandas labels Oct 10, 2023
Copy link
Contributor

@attack68 attack68 left a comment

Choose a reason for hiding this comment

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

lgtm in my files of interest

@@ -1383,6 +1391,31 @@ def format(

return self._format_with_header(header=header, na_rep=na_rep)

_default_na_rep = "NaN"
Copy link
Member

Choose a reason for hiding this comment

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

Is this correct if the data is a masked array with NA?

Copy link
Member Author

Choose a reason for hiding this comment

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

ATM Index.format and DTI.format have different defaults for na_rep. Putting this here keeps the same behavior for _format_flat while avoiding the need for overrding the whole method in DTI.

Looks like na_rep is ignored inside format_with_header anyway

Copy link
Member

Choose a reason for hiding this comment

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

Looks like na_rep is ignored inside format_with_header anyway

That's probably not good, but I guess that can be tackled elsewhere

@mroeschke mroeschke added this to the 2.2 milestone Oct 13, 2023
@mroeschke mroeschke merged commit 2f3b0ed into pandas-dev:main Oct 13, 2023
@mroeschke
Copy link
Member

Thanks @jbrockmendel

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Deprecate Functionality to remove in pandas Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DEPR: Index.format?
3 participants