import pandas as pd import seaborn as sns # 表示数值大小 - 背景颜色深浅 color_map = sns.light_palette("green", as_cmap=True) students = pd.read_excel("C:/Users/18124/Desktop/pandas/025_条件格式化/Students.xlsx", engine="openpyxl", index_col="ID") students.style.background_gradient(color_map, subset=["Test_1", "Test_2", "Test_3"])
import pandas as pd import seaborn as sns students = pd.read_excel("C:/Users/18124/Desktop/pandas/025_条件格式化/Students.xlsx", engine="openpyxl", index_col="ID") # 表示数值大小 - 背景颜色填充 students.style.bar(color="orange", subset=["Test_1", "Test_2", "Test_3"])