quandl / quandl-python

MIT License
1.37k stars 336 forks source link

Date Column not returned in call #88

Closed mikeyoungyoung closed 7 years ago

mikeyoungyoung commented 7 years ago

Is it possible to have the date column return in the dataframe?

RaymondMcT commented 7 years ago

Hi Mike,

Are you referring to the date column within the index? Having that moved to be within the data section of the data frame?

mikeyoungyoung commented 7 years ago

Yes. Essentially, when I pull down the table into a spark dataframe I only get the values column with no dates

RaymondMcT commented 7 years ago

It is not possible for us to change that at the package level. There is a lot of functionality that depends on the index being predefined. The index will need to be dropped on the dataframe after you download it. You could patch it locally in this manner:

def quandl_get_noind(dataset, **kwargs):
    df = quandl.get(dataset, **kwargs)
    df.reset_index(drop=False, inplace=True)
    return df

quandl_get_noind('NSE/OIL', rows=5)