python模块'pandas'没有属性'plotting'

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47610316/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 04:51:28  来源:igfitidea点击:

python module 'pandas' has no attribute 'plotting'

pythonpandas

提问by Harrymissu

I am a beginner of Python. I follow the machine learning course of Intel. And I encounter some troubles in coding. I run the code below in Jupyter and it raises an AttributeError.

我是 Python 的初学者。我遵循英特尔的机器学习课程。我在编码中遇到了一些麻烦。我在 Jupyter 中运行下面的代码,它引发了一个AttributeError.

import pandas as pd
step_data = [3620, 7891, 9761,3907, 4338, 5373]
step_counts = pd.Series(step_data,name='steps')
print(step_counts)

AttributeError: module 'pandas' has no attribute 'plotting'

AttributeError: 模块“pandas”没有属性“plotting”

回答by Sai Kiran Manthuri

In your terminal type

在您的终端类型中

pip install plotting. 

回答by Hasee Amarathunga

Update your pandas version using following command

使用以下命令更新您的Pandas版本

pip install --upgrade pandas

回答by Aditya Lohia

If you want to execute pipcommand directly in Jupyter notebook, run the following:

如果要直接在 Jupyter notebook 中执行pip命令,请运行以下命令:

import sys
!{sys.executable} -m pip install --upgrade pandas

The above code makes sure that the package is installed for the same version of python installed with Jupyter notebook.

上面的代码确保为与 Jupyter notebook 安装的相同版本的 python 安装了该包。

In some situations the below command also works:

在某些情况下,以下命令也有效:

!pip install --upgrade pandas

回答by HridayT

Updating pandas usually corrects this error. Hence update your version of pandas and the error should be solved. Additionally, your code snippet does work.

更新Pandas通常会纠正这个错误。因此,更新您的Pandas版本,错误应该得到解决。此外,您的代码片段确实有效。

The code snippet with the latest version of pandas

The code snippet with the latest version of pandas