Whenever I try to run my code in VS Studio, it says 'Exception has occurred: ImportError Missing optional dependency 'openpyxl'. Use pip or conda to install openpyxl.'
I have tried running pip install and selecting a different interpreter, but it still doesn't work.
import pandas as pd
# read data from excel
data = pd.read_excel("a-millennium-of-macroeconomic-data-for-the-uk.xlsx", sheet_name = 'A1. Headline series', header = 3, usecols = 'A,AP,AT')
# clean data for plotting
data = data.drop(0,1,2,)
data.columns = ['Year', 'CPI_inflation', 'Short_term_rate']
data.CPI_inflation=pd.to_numeric(data.CPI_inflation)
data.Short_term_rate = pd.to_numeric(data.Short_term_rate)
data_plot = data(data.Year >= 1930)
# plotting
plot = data_plot.plot( x = 'Year', y = ["CPI_inflation", 'Short_term_rate'], title = "Historical CPI-Inflation and Short Term Rates")
plot.set_ylabel('%')