calculate_bin_edges#
- astropy.stats.calculate_bin_edges(a: ArrayLike, bins: int | list[int | float] | Literal['blocks', 'knuth', 'scott', 'freedman'] | None = 10, range: tuple[int | float, int | float] | None = None, weights: ArrayLike | None = None) NDArray[float][source]#
 Calculate histogram bin edges like
numpy.histogram_bin_edges.- Parameters:
 - anumpy:array_like
 Input data. The bin edges are calculated over the flattened array.
- bins
python:int,python:list, orpython:str, optional If
binsis an int, it is the number of bins. If it is a list it is taken to be the bin edges. If it is a string, it must be one of ‘blocks’, ‘knuth’, ‘scott’ or ‘freedman’. Seehistogramfor a description of each method.- range
python:tupleorpython:None, optional The minimum and maximum range for the histogram. If not specified, it will be (a.min(), a.max()). However, if bins is a list it is returned unmodified regardless of the range argument.
- weightsnumpy:array_like, optional
 An array the same shape as
a. If given, the histogram accumulates the value of the weight corresponding toainstead of returning the count of values. This argument does not affect determination of bin edges, though they may be used in the future as new methods are added.
- Returns:
 - bins
ndarray Histogram bin edges
- bins