import pandas as pd
import matplotlib.pyplot as plt
# Plotting Avg. Area Income vs Price
plt.plot(usa_housing['Avg. Area Income'], usa_housing['Price'], color = 'red', marker = 'o')
# Giving title and label names
plt.title('Avg. Area Income Vs Price', fontsize = 14)
plt.xlabel('Avg. Area Income', fontsize = 14)
plt.ylabel('Price', fontsize = 14)
plt.grid(True)
plt.show()
Output return:
NameError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_12188\450110948.py in <module>
3 # Plotting Avg. Area Income vs Price
4
----> 5 plt.plot(usa_housing['Avg. Area Income'], usa_housing['Price'], color = 'red', marker = 'o')
6
7 # Giving title and label names
NameError: name 'usa_housing' is not defined
I want to get a plot of Avg. Area Income against Price