To make a histogram the data is sorted into 'bins'. If we do not specify the bins, the default value assigned by matplotlib to bins is ____________.
To make a histogram the data is sorted into 'bins'. If we do not specify the bins, the default value assigned by matplotlib to bins is ____________.
Solution
✅ Correct Option: 2
In matplotlib, plt.hist() uses bins=10 by default. If you do not pass the bins argument, the data range is divided into 10 equal-width bins.
Option 1: 5 is not the default, but it is a common guess. You can set it yourself with bins=5.
Option 4: Omitting bins does not raise an error, because the argument is optional.
Related questions:
2026: 29 May Shift 1
2025: 27 May Shift 2
2026: 13 May Shift 2
2026: 19 May Shift 1
2025: 16 May Shift 1