python使用问题 "The pandas.io.data module is moved to a separate package "
来源:互联网 发布:泰坦军团 显示器 知乎 编辑:程序博客网 时间:2024/06/05 11:32
1 import pandas as pd 2 import datetime 3 import pandas.io.data as web 4 import matplotlib.pyplot as plt 5 from matplotlib import style 6 7 style.use('ggplot') 8 9 start = datetime.datetime(2010,1,1)10 end = datetime.datetime(2015,1,1)11 12 df = web.DataReader("XOM","yahoo",start,end)13 14 print(df.head())15 16 df['Adj Close'].plot()17 18 plt.show()
问题:
"C:\Program Files\Anaconda3\python.exe" C:/Users/Administrator/PycharmProjects/untitled1/new.py
Traceback (most recent call last):
File "C:/Users/Administrator/PycharmProjects/untitled1/new.py", line 3, in <module>
import pandas.io.data as web
File "C:\Program Files\Anaconda3\lib\site-packages\pandas\io\data.py", line 2, in <module>
"The pandas.io.data module is moved to a separate package "
ImportError: The pandas.io.data module is moved to a separate package (pandas-datareader). After installing the pandas-datareader package (https://github.com/pandas-dev/pandas-datareader), you can change the import ``from pandas.io import data, wb`` to ``from pandas_datareader import data, wb``.Process finished with exit code 1
解决:
1、安装pandas-datareader
pip install pandas-datareader
2、修改代码
将import pandas.io.data as web
改为
import pandas_datareader.data as web
import pandas as pdimport datetimeimport pandas_datareader.data as webimport matplotlib.pyplot as pltfrom matplotlib import stylestyle.use('ggplot')start = datetime.datetime(2010,1,1)end = datetime.datetime(2015,1,1)df = web.DataReader("XOM","yahoo",start,end)print(df.head())df['Adj Close'].plot()plt.show()
来源:https://www.cnblogs.com/ttrrpp/p/6668675.html
- python使用问题 "The pandas.io.data module is moved to a separate package "
- 解决:react native使用TabNavigator报错 PropTypes has been moved to a separate package...
- Mysql5.6 + Python 3.3遇到问题“ImportError: No module named 'mysql.connector'; mysql is not a package”
- 错误解决:Unable to add module to the current project as it is not of package
- Python pandas.io.data 模块迁移
- Python pandas.io.data 模块迁移
- Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.
- Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.
- Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package
- springboot警告:ApplicationContext is unlikely to start due to a @ComponentScan of the default package
- Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package
- Publish module contexts to separate XML files
- there is a problem parsing the package
- No module named 'html.entities'; 'html' is not a package
- No module named 'keras.datasets'; 'keras' is not a package
- The request filtering module is configured to deny a request where the query string is too long.
- python module package
- python module, package
- win10 R语言安装rJava包 及 安装jdk环境配置
- Ubuntu16.04安装NVIDIA驱动时的一些坑与解决方案
- C++不同于C的主要细节
- fatal error C1083: 无法打开包括文件:“afxcontrolbars.h”: No such file or directory
- Leetcode | SQL
- python使用问题 "The pandas.io.data module is moved to a separate package "
- 2.XML语言
- opencv网站
- 文章标题
- 许知远:最伟大的世界并不是最嘈杂的时候,而是我们最寂静的时刻
- Uber宣布着手规划空中的士交通系统,我们可以考虑这些事情了
- 群雄逐鹿,谁是未来商业的新主流? | 36氪WISE新商业大会榜单评选正式启动
- 创业者对商业行为合法性有疑问?来看看《反不正当竞争法》的十个问答
- 反向思考,为什么对你这么重要