Interpolate debt/GDP and compare to unemployment
Since you have learned how to interpolate time series, you can now apply this new skill to the quarterly debt/GDP series, and compare the result to the monthly unemployment rate.
Diese Übung ist Teil des Kurses
Manipulating Time Series Data in Python
Anleitung zur Übung
We have imported pandas
as pd
and matplotlib.pyplot
as plt
for you.
- Use
pd.read_csv()
to import'debt_unemployment.csv'
, creating aDateTimeIndex
from the'date'
column usingparse_dates
andindex_col
, and assign the result todata
.print()
the.info()
of the data. - Apply
.interpolate()
todata
and assign this tointerpolated
, then inspect the result. - Plot
interpolated
with'Unemployment'
on thesecondary_y
axis.
Interaktive Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
# Import & inspect data here
data = ____
print(____)
# Interpolate and inspect here
interpolated = ____
print(____)
# Plot interpolated data here