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

Function _hist_bin_rice

numpy/lib/_histograms_impl.py:76–97  ·  view source on GitHub ↗

Rice histogram bin estimator. Another simple estimator with no normality assumption. It has better performance for large data than Sturges, but tends to overestimate the number of bins. The number of bins is proportional to the cube root of data size (asymptotically optimal). T

(x, range)

Source from the content-addressed store, hash-verified

74
75
76def _hist_bin_rice(x, range):
77 """
78 Rice histogram bin estimator.
79
80 Another simple estimator with no normality assumption. It has better
81 performance for large data than Sturges, but tends to overestimate
82 the number of bins. The number of bins is proportional to the cube
83 root of data size (asymptotically optimal). The estimate depends
84 only on size of the data.
85
86 Parameters
87 ----------
88 x : array_like
89 Input data that is to be histogrammed, trimmed to range. May not
90 be empty.
91
92 Returns
93 -------
94 h : An estimate of the optimal bin width for the given data.
95 """
96 del range # unused
97 return _ptp(x) / (2.0 * x.size ** (1.0 / 3))
98
99
100def _hist_bin_scott(x, range):

Callers

nothing calls this directly

Calls 1

_ptpFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…