从Quandl返回的数位数据中的三个点

时间:2019-02-03 08:57:48

标签: python numpy quandl

我在下面的Python中尝试了此代码:

import quandl
data2 = quandl.get("EIA/PET_RWTC_D", returns="numpy")
print(data2)

然后我收到了此反馈:

a return of numpy matrix but with ... after the third line, then data between year 1986 and 2019 are missing

我可以知道那些“ ...”是什么意思,我在1986年至2019年之间的数据在哪里?

1 个答案:

答案 0 :(得分:1)

点代表屏幕上未显示的信息。在1986年至2019年之间有一些记录没有打印出来,因此,如果您熟悉pandas.DataFrame,整个屏幕就不会溢出数据。

您可以通过检查形状来检查数据是否确实存在于数组中。

>>> data.shape
(8350,)

切片数组以查看任何区域中的数据。

>>> data[3300:3320]
rec.array([('1999-01-05T00:00:00.000000000', 12.04),
       ('1999-01-06T00:00:00.000000000', 12.84),
       ('1999-01-07T00:00:00.000000000', 12.99),
       ('1999-01-08T00:00:00.000000000', 13.06),
       ('1999-01-11T00:00:00.000000000', 13.43),
       ('1999-01-12T00:00:00.000000000', 12.91),
       ('1999-01-13T00:00:00.000000000', 12.33),
       ('1999-01-14T00:00:00.000000000', 12.23),
       ('1999-01-15T00:00:00.000000000', 12.21),
       ('1999-01-19T00:00:00.000000000', 12.13),
       ('1999-01-20T00:00:00.000000000', 11.82),
       ('1999-01-21T00:00:00.000000000', 12.45),
       ('1999-01-22T00:00:00.000000000', 12.62),
       ('1999-01-25T00:00:00.000000000', 12.41),
       ('1999-01-26T00:00:00.000000000', 12.16),
       ('1999-01-27T00:00:00.000000000', 12.4 ),
       ('1999-01-28T00:00:00.000000000', 12.52),
       ('1999-01-29T00:00:00.000000000', 12.81),
       ('1999-02-01T00:00:00.000000000', 12.36),
       ('1999-02-02T00:00:00.000000000', 12.21)],
      dtype=[('Date', '<M8[ns]'), ('Value', '<f8')])