Search code examples
pythonnumpyquandl

Three Dots in Returned Numpy Data from Quandl


I tried this code in Python below:

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

then i received this as feedback:

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

may i know what does those "..." mean and where are my data between 1986 and 2019???


Solution

  • The dots represent information that is not shown in the screen. There are records between 1986 and 2019 that are not printed so that your whole screen doesn't overflow with data, much like a pandas.DataFrame, if you're familiar with it.

    You can check that your data is in fact present in the array by examining the shape.

    >>> data.shape
    (8350,)
    

    Slice the array to view data in any region.

    >>> 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')])