diff options
author | Johannes Schönberger <hannesschoenberger@gmail.com> | 2013-01-13 12:51:02 +0100 |
---|---|---|
committer | Johannes Schönberger <jschoenberger@demuc.de> | 2013-06-06 21:15:44 +0200 |
commit | 474ec4858cd3b6a09cd8bec01c67759d95896cca (patch) | |
tree | d619fa7943a1de04d377bc40a6d3c53227b9cbe7 /numpy/core/numeric.py | |
parent | 27f0781e545b892f9393bad35fec149ed0718864 (diff) | |
download | numpy-474ec4858cd3b6a09cd8bec01c67759d95896cca.tar.gz |
Add tests for filled_like function
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 9a4146f9e..ce05b3a3f 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -223,12 +223,6 @@ def ones_like(a, dtype=None, order='K', subok=True): multiarray.copyto(res, 1, casting='unsafe') return res -def _check_dtype_nan(dtype): - if not issubdtype(dtype, 'float'): - raise ValueError('Invalid dtype because only floating point numbers ' - 'can represent non-numbers as defined in ' - 'IEEE 754-1985.') - def filled(shape, val, dtype=None, order='C'): """ Return a new array of given shape and type, filled with `val`. @@ -251,8 +245,6 @@ def filled(shape, val, dtype=None, order='C'): empty : Return a new uninitialized array. """ - - _check_dtype_nan(dtype) a = empty(shape, dtype, order) multiarray.copyto(a, val, casting='unsafe') return a @@ -292,8 +284,6 @@ def filled_like(a, val, dtype=None, order='K', subok=True): filled : Fill a new array. """ - - _check_dtype_nan(dtype) res = empty_like(a, dtype=dtype, order=order, subok=subok) multiarray.copyto(res, val, casting='unsafe') return res |