Reputation: 346
Okay, so I've scoured the net for this but no dice. I am trying to change the background color of my header row in my dataframe to blue.
My code:
def color_blue(val):
color = 'blue'
return['background-color: blue']
s = wci_fmo.iloc[:0].style.apply(color_blue)
s
But I get the following error:
ValueError: Function <function color_blue at 0x000000000BD0F730> returned the wrong shape.
Result has shape: (7,)
Expected shape: (0, 7)
Please help! I have numpy, pandas, and seaborn imported.
Upvotes: 1
Views: 2111
Reputation: 464
Use backgroundColor instead background-color. The first is for javascript, DOM manipulation. The second one is for CSS style declaration.
Upvotes: 1