diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-01-04 22:37:16 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-01-04 22:37:16 +0000 |
commit | 5cfcf93bf09c3a78654099ddcb3b7b184e8d4615 (patch) | |
tree | 2ba7ac321aa765f08bc2413f178fd74d4eb8c1ff /numpy/lib/ufunclike.py | |
parent | 490712cd35dcecfc9423de4bde0b29cb012dda25 (diff) | |
download | numpy-5cfcf93bf09c3a78654099ddcb3b7b184e8d4615.tar.gz |
More fixes...
Diffstat (limited to 'numpy/lib/ufunclike.py')
-rw-r--r-- | numpy/lib/ufunclike.py | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/numpy/lib/ufunclike.py b/numpy/lib/ufunclike.py index ee5d918d6..c291c7e9c 100644 --- a/numpy/lib/ufunclike.py +++ b/numpy/lib/ufunclike.py @@ -2,11 +2,11 @@ Module of functions that are like ufuncs in acting on arrays and optionally storing results in an output array. """ -__all__ = ['fix', 'isneginf', 'isposinf', 'sign', 'log2'] +__all__ = ['fix', 'isneginf', 'isposinf', 'log2'] import numpy.core.numeric as nx from numpy.core.numeric import asarray, empty, empty_like, isinf, signbit, zeros -import umath +import numpy.core.umath as umath def fix(x, y=None): """ Round x to nearest integer towards zero. @@ -43,24 +43,6 @@ def isneginf(x, y=None): umath.logical_and(isinf(x), signbit(x), y) return y -def sign(x, y=None): - """sign(x) gives an array with shape of x with elexents defined by sign - function: where x is less than 0 return -1, where x greater than 0, a=1, - elsewhere a=0. - """ - x = asarray(x) - if y is None: - y = zeros(x.shape, dtype=nx.int_) - if x.ndim == 0: - if x < 0: - y -= 1 - elif x > 0: - y += 1 - else: - y[x<0] = -1 - y[x>0] = 1 - return y - _log2 = umath.log(2) def log2(x, y=None): """Returns the base 2 logarithm of x |