It drove me crazy in the last hour. I can draw a histogram when I use:
hist(df.GVW, bins=50, range=(0,200))
I use the following when I need to filter the dataframe for a given condition in one of the columns, for example:
df[df.TYPE=='SU4']
So far, everything is working. When I try to get a histogram of this filtered data, I get a key error: KeyError: 0L . For a histogram of filtered data, I use the following:
hist(df[df.TYPE=='SU4'].GVW, bins=50, range=(0,200))
Is there a syntax error somewhere? Thanks for the help!
python matplotlib pandas histogram
marillion
source share