Before averaging a column, look at how its values are spread:
- Histogram:
rentals["duration_min"].plot.hist(bins=20) counts values in 20 equal-width bins. bins=[0, 5, 10, 20, 40] sets the edges yourself.
- Box plot:
rentals.boxplot(column="duration_min", by="bike_type") shows the middle half of the values as a box, the median as a line, and outliers as dots, one box per group.
- Scatter plot:
rentals.plot.scatter(x="duration_min", y="price") shows whether two columns move together.
For a column of a few categories or ratings, a bar chart of value_counts() is the histogram you want, and sort_index() keeps the categories in their natural order rather than by count.