Can't truncate pandas dataframe from quandl

51 Views Asked by At

Enter image description here

All my data is being pulled from quandl into pandas dataframes. For whatever reason when I call the dataframe function truncate, it seems to have no effect.

oil = pd.DataFrame(qd.get('OPEC/ORB'))
plat= pd.DataFrame(qd.get('LPPM/PLAT', column_index='1'))
pall = pd.DataFrame(qd.get('LPPM/PALL', column_index='1'))


pall.truncate(before='2003-01-02')


print(pall.head())
1

There are 1 best solutions below

0
dataista On BEST ANSWER

You need to assign the result of the truncation to the variable:

pall = pall.truncate(before='2003-01-02')

Otherwise, the operation is not persisted.