diff options
author | Matti Picus <matti.picus@gmail.com> | 2019-05-19 09:34:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-19 09:34:58 +0300 |
commit | ecb402499dba2d105b2714a55259352c31a62bd5 (patch) | |
tree | bcf388f945fc2eb9d4c151f776e030a65fb7fed7 /numpy/lib/histograms.py | |
parent | db595a0c4064956d2f2f904ed4a76443322bb7e9 (diff) | |
parent | 7495de475c8c578a0c39b09bc55a88a93aa1985a (diff) | |
download | numpy-ecb402499dba2d105b2714a55259352c31a62bd5.tar.gz |
Merge branch 'master' into npy-2.1
Diffstat (limited to 'numpy/lib/histograms.py')
-rw-r--r-- | numpy/lib/histograms.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/numpy/lib/histograms.py b/numpy/lib/histograms.py index bd44d2732..ee9a3053c 100644 --- a/numpy/lib/histograms.py +++ b/numpy/lib/histograms.py @@ -555,14 +555,14 @@ def histogram_bin_edges(a, bins=10, range=None, weights=None): using the `ptp` of the data. The final bin count is obtained from ``np.round(np.ceil(range / h))``. - 'Auto' (maximum of the 'Sturges' and 'FD' estimators) + 'auto' (maximum of the 'sturges' and 'fd' estimators) A compromise to get a good value. For small datasets the Sturges value will usually be chosen, while larger datasets will usually default to FD. Avoids the overly conservative behaviour of FD and Sturges for small and large datasets respectively. Switchover point is usually :math:`a.size \approx 1000`. - 'FD' (Freedman Diaconis Estimator) + 'fd' (Freedman Diaconis Estimator) .. math:: h = 2 \frac{IQR}{n^{1/3}} The binwidth is proportional to the interquartile range (IQR) @@ -570,7 +570,7 @@ def histogram_bin_edges(a, bins=10, range=None, weights=None): conservative for small datasets, but is quite good for large datasets. The IQR is very robust to outliers. - 'Scott' + 'scott' .. math:: h = \sigma \sqrt[3]{\frac{24 * \sqrt{\pi}}{n}} The binwidth is proportional to the standard deviation of the @@ -580,14 +580,14 @@ def histogram_bin_edges(a, bins=10, range=None, weights=None): outliers. Values are very similar to the Freedman-Diaconis estimator in the absence of outliers. - 'Rice' + 'rice' .. math:: n_h = 2n^{1/3} The number of bins is only proportional to cube root of ``a.size``. It tends to overestimate the number of bins and it does not take into account data variability. - 'Sturges' + 'sturges' .. math:: n_h = \log _{2}n+1 The number of bins is the base 2 log of ``a.size``. This @@ -595,7 +595,7 @@ def histogram_bin_edges(a, bins=10, range=None, weights=None): larger, non-normal datasets. This is the default method in R's ``hist`` method. - 'Doane' + 'doane' .. math:: n_h = 1 + \log_{2}(n) + \log_{2}(1 + \frac{|g_1|}{\sigma_{g_1}}) @@ -607,7 +607,7 @@ def histogram_bin_edges(a, bins=10, range=None, weights=None): estimates for non-normal datasets. This estimator attempts to account for the skew of the data. - 'Sqrt' + 'sqrt' .. math:: n_h = \sqrt n The simplest and fastest estimator. Only takes into account the |