init_histogram¶
- nbi_stat.init_histogram(bins, weighted=False)[source]¶
Initialize a histogram structure
The returned structure can be passed to fill_histogram as the second argument unraveled by a *
- Parameters:
bins (array-like) – Array of bin borders of length N+1
weighted (bool, optional) – If true, then also include space for weighted filling
- Returns:
bins (array-like) – The bin borders. Returned here so we can pass to fill_histogram
sumw (array-like) – The N bin content holders
sumw2 (array-like or None) – The N bin squared weights
Examples
>>> hist = init_histogram(np.linspace(-3,3,31))
See also