Skip to content
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

using the dataframe HTML styler changes representation of NaNs #12710

Open
jrenner opened this issue Mar 24, 2016 · 2 comments
Open

using the dataframe HTML styler changes representation of NaNs #12710

jrenner opened this issue Mar 24, 2016 · 2 comments
Labels
Enhancement IO HTML read_html, to_html, Styler.apply, Styler.applymap Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Comments

@jrenner
Copy link

jrenner commented Mar 24, 2016

The regular output of a dataframe with NaN values displays them as "NaN",

when using the HTML styler, they are displayed as "nan"

I'm not sure if this breaks anything but it is an inconsistency.

@jreback
Copy link
Contributor

jreback commented Mar 24, 2016

I don't think there is currently any way to actually specify how these display, and they are default rendered. You could do:

.format(lambda x: 'NaN' if pd.isnull(x) else x) I think

but agreed we prob need this to be the same (and settable)

cc @TomAugspurger

@jreback jreback added Enhancement Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Output-Formatting __repr__ of pandas objects, to_string IO HTML read_html, to_html, Styler.apply, Styler.applymap Difficulty Intermediate labels Mar 24, 2016
@jreback jreback added this to the Next Major Release milestone Mar 24, 2016
@TomAugspurger
Copy link
Contributor

Yeah, the default should changed. For .style it's defined here but should probably just be reusing pieces from https://github.com/pydata/pandas/blob/master/pandas/core/format.py

@mroeschke mroeschke removed the Output-Formatting __repr__ of pandas objects, to_string label Apr 23, 2021
@mroeschke mroeschke removed this from the Contributions Welcome milestone Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement IO HTML read_html, to_html, Styler.apply, Styler.applymap Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

No branches or pull requests

5 participants