Skip to main contentSkip to solution

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.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question