python - Seaborn 线图模块对象没有属性“线图”
问题描述
使用 seaborn 的文档代码生成线图会返回 AttributeError:“模块”对象没有属性“线图”。我已经更新了 seaborn 并重新导入了模块并再次尝试,没有运气。lineplot 是否退休了,还是发生了其他事情?
import seaborn as sns; sns.set()
import matplotlib.pyplot as plt
fmri = sns.load_dataset("fmri")
ax = sns.lineplot(x="timepoint", y="signal", data=fmri)
解决方案
如果你使用 conda,你需要安装 seaborn 指定的版本:
conda install -c anaconda seaborn=0.9.0
正确安装 seaborn 0.9.0 后,您应该能够使用 lineplot 功能(至少它适用于我的)。
这样你就不必离开 conda 生态系统并使用 seaborn 和 pip。
推荐阅读
- intellij-idea - 将文件添加到打包 IntelliJ
- sql - oracle sql developer字符串文字太长绑定变量大于4000个字符
- angularjs - AngularJS过滤服务循环
- apache-spark - 如何使用 Pyspark 缓存增强的数据帧
- php - 语法错误或访问冲突:1064 - PDO 插入错误
- excel - 在VBA中使用Worksheet_Change事件,有一个范围,如果值没有,如何返回相邻单元格的值
- c# - 实现 FlagsAttribute 时将 Enum 解析为 Enum
- annotations - 使用 Anychart 的股票图表将鼠标悬停在绘图(注释)上时是否可以添加工具提示
- python - “Pythonic”/更优雅的方式将多个变量设置为同一个函数调用或列表理解
- python - Python如何检查输入是字母还是字符