首页 > 代码库 > Python pandas.io.data 模块迁移

Python pandas.io.data 模块迁移

  这段时间用pandas做数据分析,

import pandas.io.data as web 

 然后得到下面的错误提示

    "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``.

  原来是迁移到了pandas-datareader包,但是 

import pandas-datareader.io.data as web 

 仍然错误,于是我进Pypi查了一下这个包,原来这个包从0.19.0已经不再支持 pandas.io.data 和 pandas.io.wb,需将pandas.io换成pandas_datareader,即

import pandas_datareader.data as web

 

Python pandas.io.data 模块迁移