pandas.tools 在哪里

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/54473018/
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 06:18:13  来源:igfitidea点击:

Where is pandas.tools

python-3.xpandas

提问by Ivan

After installing pandas:

安装后pandas

idf:~/Documents/python/plot$ pip3 install pandas --user
Collecting pandas
  Using cached https://files.pythonhosted.org/packages/f9/e1/4a63ed31e1b1362d40ce845a5735c717a959bda992669468dae3420af2cd/pandas-0.24.0-cp36-cp36m-manylinux1_x86_64.whl
Requirement already satisfied: numpy>=1.12.0 in /home/idf/.local/lib/python3.6/site-packages (from pandas) (1.15.4)
Requirement already satisfied: pytz>=2011k in /home/idf/.local/lib/python3.6/site-packages (from pandas) (2018.7)
Requirement already satisfied: python-dateutil>=2.5.0 in /home/idf/.local/lib/python3.6/site-packages (from pandas) (2.7.5)
Requirement already satisfied: six>=1.5 in /home/idf/.local/lib/python3.6/site-packages (from python-dateutil>=2.5.0->pandas) (1.12.0)
zipline 1.3.0 has requirement pandas<=0.22,>=0.18.1, but you'll have pandas 0.24.0 which is incompatible.
Installing collected packages: pandas
Successfully installed pandas-0.24.0
idf:~/Documents/python/plot$ 

I try to load pandas.tools,

我尝试加载pandas.tools

from pandas.tools.plotting import autocorrelation_plot

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-52-e11ce94b8d5d> in <module>
----> 1 from pandas.tools.plotting import autocorrelation_plot


ModuleNotFoundError: No module named 'pandas.tools'

How do I access pandas.tools?

我如何访问pandas.tools

回答by javabrett

Package pandas.tools.plottingwas moved to pandas.plottingin this commit, as part of #16005and #12548in Pandas 0.20.0.

作为Pandas中#16005#12548 的一部分,包在这次提交中pandas.tools.plotting被移到了。pandas.plotting0.20.0

More recently, in this commitin Pandas #23376released in Pandas 0.24.0, the deprecated pandas.toolspackage, which was previously allowing pandas.tools.plottingto keep working, was removed.

最近,在Pandas 中发布的Pandas #23376中的这个提交中,已弃用的软件包(以前允许继续工作)被删除了。0.24.0pandas.toolspandas.tools.plotting

Ergo, once you allow Pandas to upgrade to 0.24.0or later, you will need to replace imports from pandas.tools.plottingto be instead from pandas.plotting.

因此,一旦您允许 Pandas 升级到0.24.0或更高版本,您将需要将导入替换为 from 替换pandas.tools.plotting为 from pandas.plotting

回答by arilwan

Use pandas.plottinginstead.

使用pandas.plotting来代替。

Hope this helps.

希望这可以帮助。

回答by Alan Jose Tom

Traceback (most recent call last):
  File "brod.py", line 3, in <module>
    from pandas.tools.plotting import scatter_matrix
ModuleNotFoundError: No module named 'pandas.tools'

This happens in new version pandas. This

这发生在新版本的Pandas中。这个

from pandas.tools.plotting import scatter_matrix

is for old version pandas if you using new version pandas then write code

如果您使用新版本的Pandas,则用于旧版本的Pandas,然后编写代码

from pandas.plotting import scatter_matrix

instead of

代替

from pandas.tools.plotting import scatter_matrix

回答by Sivaji Siva

Use pandas.plotting instead of pandas.tools.plotting thanks

使用 pandas.plotting 而不是 pandas.tools.plotting 谢谢