Skip to content

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Oct 11, 2023

The real motivation here is avoiding the special-casing in _format_with_header.

This makes is_float_nan unnecessary, so rips it out.

@jbrockmendel jbrockmendel requested a review from WillAyd as a code owner October 11, 2023 02:45
# GH 48526
expected = """ NaN inf record
0 NaN b [0, inf, b]
0 inf b [0, inf, b]
Copy link
Member

Choose a reason for hiding this comment

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

If use_inf_as_na is enabled, shouldn't inf still be rendered as NaN?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, we still should render the "inf" accurately Notice on L413 that we already do this when the inf is in the columns

@mroeschke mroeschke added the Output-Formatting __repr__ of pandas objects, to_string label Oct 11, 2023
@mroeschke mroeschke added this to the 2.2 milestone Oct 11, 2023
@mroeschke mroeschke merged commit 943c3cb into pandas-dev:main Oct 11, 2023
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the bug-format-inf branch October 11, 2023 17:56
gupta-paras pushed a commit to gupta-paras/pandas that referenced this pull request Oct 12, 2023
* BUG: repr of inf values with use_inf_as_na

* GH ref
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants