Question

I have a pandas dataframe df, and I want to show the histogram.

df.hist(bins=100, label="myhist")

Now, for some reason I have lots of zeros in this df, so I only want to show the values between 1 and 100. I tried

df.hist(bins=(1,100), label="myhist")

but that gives a flat line which has nothing to do with the data.

How do I do it?

Was it helpful?

Solution

Ok, after some digging around I found that I can pass a range = (1,100) and that does the trick.

Licensed under: CC-BY-SA with attribution
Not affiliated with datascience.stackexchange
scroll top