style_dict={'font-family':'times','font-size':'120%',
'text-shadow':'#aaa 2px 2px 2px'}
head_styler=(('color','slategray'),('font-size','200%'),
('text-shadow','#aaa 3px 3px 3px'))
index=[chr(i) for i in range(ord('a'),ord('h')+1)];
columns=['♔','♕','♖',
'♗','♘','♙']
df=pandas.DataFrame(numpy.random.randn(8,6),
index=index,columns=columns)
df.style.set_properties(**style_dict)\
.background_gradient(cmap='Pastel1')\
.set_table_styles([dict(selector='th',props=head_styler)])
No comments:
Post a Comment