diff options
Diffstat (limited to 'numpy/lib/ufunclike.py')
-rw-r--r-- | numpy/lib/ufunclike.py | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/numpy/lib/ufunclike.py b/numpy/lib/ufunclike.py index 8f81fe4b2..b51365f41 100644 --- a/numpy/lib/ufunclike.py +++ b/numpy/lib/ufunclike.py @@ -172,45 +172,3 @@ def isneginf(x, y=None): y = nx.empty(x.shape, dtype=nx.bool_) nx.logical_and(nx.isinf(x), nx.signbit(x), y) return y - - -_log2 = nx.log(2) -def log2(x, y=None): - """ - Return the base 2 logarithm of the input array, element-wise. - This function is now deprecated, use the np.log2 ufunc instead. - - Parameters - ---------- - x : array_like - Input array. - y : array_like - Optional output array with the same shape as `x`. - - Returns - ------- - y : ndarray - The logarithm to the base 2 of `x` element-wise. - NaNs are returned where `x` is negative. - - See Also - -------- - log, log1p, log10 - - Examples - -------- - >>> np.log2([-1, 2, 4]) - array([ NaN, 1., 2.]) - - """ - import warnings - msg = "numpy.lib.log2 is deprecated, use np.log2 instead." - warnings.warn(msg, DeprecationWarning) - - x = nx.asanyarray(x) - if y is None: - y = nx.log(x) - else: - nx.log(x, y) - y /= _log2 - return y |