/usr/lib64/python2.6/site-packages/numpy/lib
NameSizeModeActions
benchmarks/-0755rm
tests/-0755rm
arraysetops.py137040644editdlrm
arraysetops.pyc133800644editdlrm
arraysetops.pyo133800644editdlrm
arrayterator.py64370644editdlrm
arrayterator.pyc70220644editdlrm
arrayterator.pyo70220644editdlrm
financial.py208720644editdlrm
financial.pyc215460644editdlrm
financial.pyo215460644editdlrm
format.py193090644editdlrm
format.pyc172790644editdlrm
format.pyo172790644editdlrm
function_base.py1005240644editdlrm
function_base.pyc991690644editdlrm
function_base.pyo991690644editdlrm
getlimits.py87900644editdlrm
getlimits.pyc100530644editdlrm
getlimits.pyo100530644editdlrm
index_tricks.py267900644editdlrm
index_tricks.pyc280080644editdlrm
index_tricks.pyo280080644editdlrm
info.py62400644editdlrm
info.pyc64250644editdlrm
info.pyo64250644editdlrm
io.py532260644editdlrm
io.pyc441020644editdlrm
io.pyo441020644editdlrm
machar.py106580644editdlrm
machar.pyc86880644editdlrm
machar.pyo86880644editdlrm
polynomial.py355620644editdlrm
polynomial.pyc381390644editdlrm
polynomial.pyo381390644editdlrm
recfunctions.py320380644editdlrm
recfunctions.pyc294510644editdlrm
recfunctions.pyo294510644editdlrm
scimath.py139970644editdlrm
scimath.pyc158670644editdlrm
scimath.pyo158670644editdlrm
setup.py5880644editdlrm
setup.pyc9180644editdlrm
setup.pyo9180644editdlrm
setupscons.py4700644editdlrm
setupscons.pyc8240644editdlrm
setupscons.pyo8240644editdlrm
shape_base.py243870644editdlrm
shape_base.pyc252910644editdlrm
shape_base.pyo252910644editdlrm
stride_tricks.py39720644editdlrm
stride_tricks.pyc38630644editdlrm
stride_tricks.pyo38630644editdlrm
twodim_base.py229460644editdlrm
twodim_base.pyc254640644editdlrm
twodim_base.pyo254640644editdlrm
type_check.py170750644editdlrm
type_check.pyc183920644editdlrm
type_check.pyo183920644editdlrm
ufunclike.py54520644editdlrm
ufunclike.pyc63110644editdlrm
ufunclike.pyo63110644editdlrm
user_array.py74750644editdlrm
user_array.pyc157270644editdlrm
user_array.pyo157270644editdlrm
utils.py340340644editdlrm
utils.pyc304220644editdlrm
utils.pyo304220644editdlrm
_compiled_base.so197200755editdlrm
_datasource.py206380644editdlrm
_datasource.pyc209860644editdlrm
_datasource.pyo209860644editdlrm
_iotools.py277120644editdlrm
_iotools.pyc269160644editdlrm
_iotools.pyo269160644editdlrm
__init__.py9360644editdlrm
__init__.pyc10380644editdlrm
__init__.pyo10380644editdlrm
Edit: /usr/lib64/python2.6/site-packages/numpy/lib/ufunclike.py (5452B)
""" Module of functions that are like ufuncs in acting on arrays and optionally storing results in an output array. """ __all__ = ['fix', 'isneginf', 'isposinf', 'log2'] import numpy.core.numeric as nx def fix(x, y=None): """ Round to nearest integer towards zero. Round an array of floats element-wise to nearest integer towards zero. The rounded values are returned as floats. Parameters ---------- x : array_like An array of floats to be rounded y : ndarray, optional Output array Returns ------- out : ndarray of floats The array of rounded numbers See Also -------- trunc, floor, ceil around : Round to given number of decimals Examples -------- >>> np.fix(3.14) 3.0 >>> np.fix(3) 3.0 >>> np.fix([2.1, 2.9, -2.1, -2.9]) array([ 2., 2., -2., -2.]) """ x = nx.asanyarray(x) if y is None: y = nx.zeros_like(x) y1 = nx.floor(x) y2 = nx.ceil(x) y[...] = nx.where(x >= 0, y1, y2) return y def isposinf(x, y=None): """ Test element-wise for positive infinity, return result as bool array. Parameters ---------- x : array_like The input array. y : array_like, optional A boolean array with the same shape as `x` to store the result. Returns ------- y : ndarray A boolean array with the same dimensions as the input. If second argument is not supplied then a boolean array is returned with values True where the corresponding element of the input is positive infinity and values False where the element of the input is not positive infinity. If a second argument is supplied the result is stored there. If the type of that array is a numeric type the result is represented as zeros and ones, if the type is boolean then as False and True. The return value `y` is then a reference to that array. See Also -------- isinf, isneginf, isfinite, isnan Notes ----- Numpy uses the IEEE Standard for Binary Floating-Point for Arithmetic (IEEE 754). Errors result if the second argument is also supplied when `x` is a scalar input, or if first and second arguments have different shapes. Examples -------- >>> np.isposinf(np.PINF) array(True, dtype=bool) >>> np.isposinf(np.inf) array(True, dtype=bool) >>> np.isposinf(np.NINF) array(False, dtype=bool) >>> np.isposinf([-np.inf, 0., np.inf]) array([False, False, True], dtype=bool) >>> x = np.array([-np.inf, 0., np.inf]) >>> y = np.array([2, 2, 2]) >>> np.isposinf(x, y) array([1, 0, 0]) >>> y array([1, 0, 0]) """ if y is None: x = nx.asarray(x) y = nx.empty(x.shape, dtype=nx.bool_) nx.logical_and(nx.isinf(x), ~nx.signbit(x), y) return y def isneginf(x, y=None): """ Test element-wise for negative infinity, return result as bool array. Parameters ---------- x : array_like The input array. y : array_like, optional A boolean array with the same shape and type as `x` to store the result. Returns ------- y : ndarray A boolean array with the same dimensions as the input. If second argument is not supplied then a numpy boolean array is returned with values True where the corresponding element of the input is negative infinity and values False where the element of the input is not negative infinity. If a second argument is supplied the result is stored there. If the type of that array is a numeric type the result is represented as zeros and ones, if the type is boolean then as False and True. The return value `y` is then a reference to that array. See Also -------- isinf, isposinf, isnan, isfinite Notes ----- Numpy uses the IEEE Standard for Binary Floating-Point for Arithmetic (IEEE 754). Errors result if the second argument is also supplied when x is a scalar input, or if first and second arguments have different shapes. Examples -------- >>> np.isneginf(np.NINF) array(True, dtype=bool) >>> np.isneginf(np.inf) array(False, dtype=bool) >>> np.isneginf(np.PINF) array(False, dtype=bool) >>> np.isneginf([-np.inf, 0., np.inf]) array([ True, False, False], dtype=bool) >>> x = np.array([-np.inf, 0., np.inf]) >>> y = np.array([2, 2, 2]) >>> np.isneginf(x, y) array([1, 0, 0]) >>> y array([1, 0, 0]) """ if y is None: x = nx.asarray(x) 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. 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.]) """ x = nx.asanyarray(x) if y is None: y = nx.log(x) else: nx.log(x, y) y /= _log2 return y