紧接上一篇,继续介绍一些设置常用格式的方法
mport pandas as pd
import numpy as np
df=pd.read_excel('D:/1.xlsx', sheet_name='Sheet1')
1、hide_index()
# 隐藏index
df.style.hide_index()
2、hide_columns()
df.style.hide_columns(['id'])
3、highlight_max(axis=None)
# 当设置axis为null时,默认会获取所有数据的最大值
df.style.highlight_max(axis=None)
哈哈,以上就是python小工具关于style的简要介绍。有兴趣欢迎关注python小工具,一起学习python和pandas。