0

Example df

How do I create a histogram that in this case only uses the range of 2–5 points, instead of the entire points data range of 1–6?

I'm trying to only display the average data spread, not the extreme areas. Is there maybe a function to zoom in to the significant ranges? And is there a smart way to describe those?

ron-png
  • 3
  • 2

1 Answers1

0

For your specific data, you can first filter your DataFrame, then call .hist(). Note that Series.between(left, right) includes both the left and right values:

df[df['points'].between(2, 5)].hist()
Peter Leimbigler
  • 10,775
  • 1
  • 23
  • 37