MCPcopy Index your code
hub / github.com/numpy/numpy / _hist_bin_sqrt

Function _hist_bin_sqrt

numpy/lib/_histograms_impl.py:32–50  ·  view source on GitHub ↗

Square root histogram bin estimator. Bin width is inversely proportional to the data size. Used by many programs for its simplicity. Parameters ---------- x : array_like Input data that is to be histogrammed, trimmed to range. May not be empty. Returns

(x, range)

Source from the content-addressed store, hash-verified

30
31
32def _hist_bin_sqrt(x, range):
33 """
34 Square root histogram bin estimator.
35
36 Bin width is inversely proportional to the data size. Used by many
37 programs for its simplicity.
38
39 Parameters
40 ----------
41 x : array_like
42 Input data that is to be histogrammed, trimmed to range. May not
43 be empty.
44
45 Returns
46 -------
47 h : An estimate of the optimal bin width for the given data.
48 """
49 del range # unused
50 return _ptp(x) / np.sqrt(x.size)
51
52
53def _hist_bin_sturges(x, range):

Callers 1

_hist_bin_autoFunction · 0.85

Calls 1

_ptpFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…