diff options
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/type_check.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/lib/type_check.py b/numpy/lib/type_check.py index 3f7aa32fa..8c79da7eb 100644 --- a/numpy/lib/type_check.py +++ b/numpy/lib/type_check.py @@ -2,6 +2,7 @@ """ from __future__ import division, absolute_import, print_function +import warnings __all__ = ['iscomplexobj', 'isrealobj', 'imag', 'iscomplex', 'isreal', 'nan_to_num', 'real', 'real_if_close', @@ -469,6 +470,10 @@ def asscalar(a): """ Convert an array of size 1 to its scalar equivalent. + .. deprecated:: 1.16 + + Deprecated, use `numpy.ndarray.item()` instead. + Parameters ---------- a : ndarray @@ -486,6 +491,10 @@ def asscalar(a): 24 """ + + # 2018-10-10, 1.16 + warnings.warn('np.asscalar(a) will be removed in v1.18 of numpy, use ' + 'a.item() instead', DeprecationWarning, stacklevel=1) return a.item() #----------------------------------------------------------------------------- |