def _get_num_bins(self, bins): if np.isscalar(bins): num_bins = bins else: num_bins = len(bins) # bins is an array of bins return num_bins