I am trying to understand how to fill the color specific to dataframe column header or to the entire dataframe background.
I've just started and google around but did not get understanding to to it, there are good links such as related link and another Link .
Datatframe Below..
>>> df = pd.DataFrame({ 'Name':['James', 'Ricardo', 'Arie', 'Ruben', 'Naveen', 'Audery'], 'Sir Name':['Pullman', 'Jacob', 'Tilman', 'Juneja', 'Therry', 'Cuenin'], 'Country':['Holland', 'Holland', 'Holland', 'Holland', 'Holland', 'Holland'], 'Age':[38,28,27,29,26,27] })
>>> df
Name Sir Name Country Age
0 James Pullman Holland 38
1 Ricardo Jacob Holland 28
2 Arie Tilman Holland 27
3 Ruben Juneja Holland 29
4 Naveen Therry Holland 26
5 Audery Cuenin Holland 27
Expected:
OR
Fill the color to the whole background
I have tried as follows but did not get the result.
>>> ss = df.style.set_table_styles([{ 'selector': 'th', 'props': [('background-color', 'black'), ('color', 'cyan')]}])
>>> print(ss)
<pandas.io.formats.style.Styler object at 0x7f5eccfedac8>