python - 'DataFrame' 对象没有属性 'iplot'

标签 python dataframe plot

我可以解决以下错误吗: “DataFrame”对象没有属性“iplot”? 我必须使用 pd.read_csv 为从 csv 文件导入的数据集的每个类别创建箱线图:

dataset = pd.read_csv(myfile)
dataset[columns].iplot(kind='box')

最佳答案

pandas dataframe 对象在未链接到 plotly 时没有 iplot 方法。我们需要cufflinks将 pandas 链接到 plotly 并添加 iplot 方法:

import cufflinks as cf
cf.go_offline()
cf.set_config_file(offline=False, world_readable=True)

在此之后,尝试直接从数据框中绘图:

dataset["columns"].iplot(kind="box")

安装袖扣:pip install cufflinks --upgrade)

关于python - 'DataFrame' 对象没有属性 'iplot',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65763648/

相关文章:

python - 从列表创建数据框时出现内存错误

r - persp() : what is wrong with my color?

r - 这是什么类型的图表?它可以使用ggplot2创建吗?

r - 如何使用 R 在一个面板中绘制贝叶斯先验分布和后验分布?

python - Pyspark 在另一列中的一列中查找模式

python - 基于文本 beautifulsoup 将 html 包装在新标签中

python - 使用 Python sshtunnel 进行端口转发休息请求

python - Numpy 数组切片期间的行与列向量返回

python - 如何在数据帧上使用 sort_index()?

python - 在pandas的分组数据中插入值为0的缺失记录