diff options
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/function_base.py | 4 | ||||
-rw-r--r-- | numpy/lib/tests/test_io.py | 6 | ||||
-rw-r--r-- | numpy/lib/tests/test_nanfunctions.py | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 9261dba22..3298789ee 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -268,14 +268,14 @@ def histogram(a, bins=10, range=None, normed=False, weights=None, large datasets respectively. Switchover point is usually x.size~1000. 'FD' (Freedman Diaconis Estimator) - .. math:: h = 2 \\frac{IQR}{n^{-1/3}} + .. math:: h = 2 \\frac{IQR}{n^{1/3}} The binwidth is proportional to the interquartile range (IQR) and inversely proportional to cube root of a.size. Can be too conservative for small datasets, but is quite good for large datasets. The IQR is very robust to outliers. 'Scott' - .. math:: h = \\frac{3.5\\sigma}{n^{-1/3}} + .. math:: h = \\frac{3.5\\sigma}{n^{1/3}} The binwidth is proportional to the standard deviation (sd) of the data and inversely proportional to cube root of a.size. Can be too conservative for small datasets, but is quite good diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index af904e96a..bffc5c63e 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -1815,9 +1815,9 @@ M 33 21.99 assert_equal(test.dtype.names, ['f0', 'f1', 'f2']) - assert test.dtype['f0'] == np.float - assert test.dtype['f1'] == np.int64 - assert test.dtype['f2'] == np.integer + assert_(test.dtype['f0'] == np.float) + assert_(test.dtype['f1'] == np.int64) + assert_(test.dtype['f2'] == np.integer) assert_allclose(test['f0'], 73786976294838206464.) assert_equal(test['f1'], 17179869184) diff --git a/numpy/lib/tests/test_nanfunctions.py b/numpy/lib/tests/test_nanfunctions.py index f418504c2..7a7b37b98 100644 --- a/numpy/lib/tests/test_nanfunctions.py +++ b/numpy/lib/tests/test_nanfunctions.py @@ -395,12 +395,12 @@ class TestNanFunctions_MeanVarStd(TestCase, SharedNanFunctionsTestsMixin): def test_dtype_error(self): for f in self.nanfuncs: - for dtype in [np.bool_, np.int_, np.object]: - assert_raises(TypeError, f, _ndat, axis=1, dtype=np.int) + for dtype in [np.bool_, np.int_, np.object_]: + assert_raises(TypeError, f, _ndat, axis=1, dtype=dtype) def test_out_dtype_error(self): for f in self.nanfuncs: - for dtype in [np.bool_, np.int_, np.object]: + for dtype in [np.bool_, np.int_, np.object_]: out = np.empty(_ndat.shape[0], dtype=dtype) assert_raises(TypeError, f, _ndat, axis=1, out=out) |