1. Learn
  2. /
  3. Courses
  4. /
  5. Importing and Managing Financial Data in Python

Connected

Exercise

Visualize the long-term oil price trend

In the previous video, you learned how to retrieve data from the Federal Reserve Economic Data (FRED) portal.

Here, you will use this new data source to visualize the oil price trend over the last 50 years, specifically, the Spot Crude Oil Price: West Texas Intermediate (WTI). DataReader, date, pandas as pd, and matplotlib.pyplot as plt have been imported.

Instructions

100 XP
  • Use date() to set start to January 1, 1968, and set series to series code 'WTISPLC'.
  • Pass series as the data,'fred' as the data source, and start as the start date to DataReader(). Assign to oil_price.
  • Inspect oil_price using .info().
  • Plot and show the oil_price series with title 'Oil Price'.