BaşlayınÜcretsiz Başlayın

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.

Bu egzersiz

Manipulating Time Series Data in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

We have imported pandas as pd and matplotlib.pyplot as plt for you.

  • Use pd.read_csv() to import 'debt_unemployment.csv', creating a DateTimeIndex from the 'date' column using parse_dates and index_col, and assign the result to data. print() the .info() of the data.
  • Apply .interpolate() to data and assign this to interpolated, then inspect the result.
  • Plot interpolated with 'Unemployment' on the secondary_y axis.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import & inspect data here
data = ____
print(____)

# Interpolate and inspect here
interpolated = ____
print(____)

# Plot interpolated data here

Kodu Düzenle ve Çalıştır