Why error? i got this after trying to do a coding for tech strategy; why?

NameError Traceback (most recent call last)
in
----> 1 plt.figure(figsize=(10,6))
2 plt.plot((df[‘Str_Return’]+1).cumprod())
3 plt.xlabel(‘Date’)
4 plt.label(‘Date’)
5 plt.ylabel(‘Returns’)

NameError: name ‘plt’ is not defined

plt is the alias name for the matplotlib library. you need to write the below line before running the code



import matplotlib.pyplot as plt



Note: In the notebook, you need to run the code cells from the start. This will ensure that all the required packages imported and the variables used in subsequent cells are initialized.



Ishan