I have a styled object that some of the cells have nan values. I need to remove the nan values while I keep the style in place.
if I do this:
new_df.data.replace(np.nan, '', regex=True)
this removes the nan values as well as the style.
Is there a way to keep the style while removing nan values from the Pandas styled object.


Edit: I noticed your issue is with the styles.
You could use this oneliner:
If you don't care about the styles you can simply use
DataFrame.replacelike this:Or get a little bit fancy using types from
Numpylike this: