1
$\begingroup$

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?

$\endgroup$
1
$\begingroup$

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.