PythonDataScienceHandbook
PythonDataScienceHandbook copied to clipboard
AttributeError in Histograms, KDE, and densities
AttributeError: 'Rectangle' object has no property 'normed'. I removed normed=True from plt.hist(data[col], normed=True, alpha=0.5)
I ran into the same issue, some coders on different forums suggest to change normed=True to density=True but I'm not quite sure if it does the same.
The problem is that you are trying to set the normed property of a Rectangle object. However, Rectangle objects do not have a normed property.
import pandas as pd
import matplotlib.pyplot as plt
data = pd.read_csv("data.csv")
plt.hist(data[col], alpha=0.5)
plt.show()