使用pandas-DataReader获取错误时间的数据

时间:2019-11-03 05:03:20

标签: python-3.x datetime pandas-datareader

我正在从熊猫数据读取器查询AAPL数据。我指定的日期为1991-1-1,但是如果您查看我收到的数据,则该日期为89-01-03。

import pandas as pd
from pandas import datetime
from pandas import DataFrame as df
import matplotlib
from pandas_datareader import data as web

data = web.DataReader("AAPl", 'yahoo', 1991-1-1, 2019-1-10)
data.index = pd.to_datetime(data.index, format ='%Y-%m-%d')

数据:

    High    Low Open    Close   Volume  Adj Close
Date                        
1989-01-03  1.446429    1.428571    1.437500    1.441964    25004000.0  1.164242
1989-01-04  1.504464    1.446429    1.455357    1.500000    59987200.0  1.211100
1989-01-05  1.544643    1.473214    1.500000    1.508929    76832000.0  1.218310
1989-01-06  1.553571    1.508929    1.508929    1.522321    49666400.0  1.229123
1989-01-09  1.540179    1.508929    1.535714    1.535714    19826800.0  1.239936
... ... ... ... ... ... ...
2007-12-24  28.475714   27.827143   27.861429   28.400000   120050700.0 24.785059
2007-12-26  28.708570   28.117144   28.430000   28.421429   175933100.0 24.803761
2007-12-27  28.994286   28.257143   28.421429   28.367144   198881900.0 24.756376
2007-12-28  28.794285   28.125713   28.655714   28.547142   174911800.0 24.913471
2007-12-31  28.642857   28.250000   28.500000   28.297142   134833300.0 24.695290
4790 rows × 6 columns

为什么我要从另一个日期开始获取数据?

0 个答案:

没有答案