I am extracting currency data from Quandl:
import Quandl
df = Quandl.get("CURRFX/USDEUR", collapse="daily")
df = df.tail(10).reset_index()
Running the code above, you can see that currency data is of course not available during the weekends.
The dataframe doesn't show the missing days rows.
Any idea on how can I add the missing days and filling them with the average of the previous week?
UPDATE:
the code I have is:
exchange = Quandl.get("CURRFX/USDEUR", trim_start="2016-02-01",trim_end="2016-02-28")
exchange = exchange.drop(['High (est)','Low (est)'], axis = 1)
exchange = exchange.reindex(pd.date_range(start=exchange.index[0], end=exchange.index[-1])).ffill().reset_index()
exchange = exchange.rename(columns={'index':'Day','Rate':'exchange'})
Of course, imagine I run it monday morning, I still dont have data for the whole date so the privious sunday and saturday stay empty...
How can I fill them out?