PythonDataScienceHandbook icon indicating copy to clipboard operation
PythonDataScienceHandbook copied to clipboard

AttributeError in Histograms, KDE, and densities

Open hamza3laa opened this issue 4 years ago • 2 comments

AttributeError: 'Rectangle' object has no property 'normed'. I removed normed=True from plt.hist(data[col], normed=True, alpha=0.5)

hamza3laa avatar Nov 13 '21 08:11 hamza3laa

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.

Schiavi13 avatar Jun 18 '22 01:06 Schiavi13

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()

Sourav544 avatar Jul 09 '23 06:07 Sourav544