fig,axes = plt.subplots(nrows=1, ncols=2)
for current_ax in axes:
current_ax.plot(x,y)
I am copypasting the code from Python in Data Science lecture. Using matplotlib and getting an error: NameError: name 'x' is not defined
. I was following the q&a section but no one had this problem before.
You obviously haven’t copied enough of the code from the lecture. There clearly IS NO definition of
x
in the code, so the error means exactly what it says.