假设我们要突出显示 100 到 200 之间的值,这个怎么实现呢?我们可以通过 dataframe.style.highlight_between(left, right)
来实现这个功能。如下图是对 100 到 200 之间的数填充黄色底色。
# 背景为黄色,文本为黑色,突出显示 100 到 200 之间的值
df_pivoted.style.highlight_between(left=100, right=200, props='color:black;background-color:yellow')
module not found
你的pandas包不识别
看下面报错信息,不是pandas本身识不出来,是pandas下面的包不识别
很可能pandas版本和py版本不兼容
问题点:文件读取失败, 报错:模块未找到.
分析:模块未找到,图中显示用pandas库.应该是pandas库出问题.
解决办法: 重装pandas库
若之前已经安装过pandas库,尝试下面的方法
pip install --upgrade pandas