How to make styler object to dataframe

Viewed 25

I want to replace nan in html to blank space but when I'm using s.replace I'm getting

AttributeError: 'Styler' object has no attribute 'replace'

This is what I was trying

s=b.style.apply(lambda x: ["background-color: green"]*n if x['MessageType']== '[43503]' else ["background-color: white"]*n, axis = 1)

s= s.replace(r'^\s*$', np.nan, regex=True)
s.to_html("SORTED.html")
0 Answers
Related