学习《利用python进行数据分析》遇到的问题1

使用的《python for data analysis》版本是2014年版。

在本书P145,展示了一个使用dataframe计算相关系数和协方差的例子,里边涉及一个名为pandas.io.data的库,以及对应的get_data_yahoo方法。实测代码无法运行。具体变化如下:

  1. 库名从pandas.io.data更改为pandas_datareader,即import语句要对应改成import pandas_datareader.data as xxx或者 import pandas_datareader.web as xxx

  2. 关注api接口的情况,部分摘录在下(原文请去https://pandas-datareader.readthedocs.io/en/latest/remote_data.html

  • Yahoo! Finance has been immediately deprecated. Yahoo! substantially altered their API in late 2017 and the csv endpoint was retired.

  • Google’a API has become less reliable during 2017. While the google datareader often works as expected, it is not uncommon to experience a range of errors when attempting to read data, especially in bulk.

  • Currently the following sources are supported:
    Google Finance
    Morningstar
    IEX
    Robinhood
    Enigma
    Quandl
    St.Louis FED (FRED)
    Kenneth French’s data library
    World Bank
    OECD
    Eurostat
    Thrift Savings Plan
    Nasdaq Trader symbol definitions
    Stooq
    MOEX

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值