2020
10-08
10-08
pandas to_excel 添加颜色操作
我就废话不多说了,大家还是直接看代码吧~importpandasaspdimportnumpyasnpcolumns=[['A','A','B','B','C'],['a','b','c','d','e']]#创建形状为(10,5)的DataFrame并设置二级标题demo_df=pd.DataFrame(np.arange(50).reshape(10,5),columns=columns)print(demo_df)defstyle_color(df,colors):""":paramdf:pd.DataFrame:paramcolors:字典内容是{标题:颜色}:return:"""returndf...
继续阅读 >