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)
| 30 | |
| 31 | |
| 32 | def _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 | |
| 53 | def _hist_bin_sturges(x, range): |
no test coverage detected
searching dependent graphs…