Hackfut Security File Manager
Current Path:
/opt/alt/python27/lib64/python2.7/site-packages/numpy/core
opt
/
alt
/
python27
/
lib64
/
python2.7
/
site-packages
/
numpy
/
core
/
📁
..
📄
__init__.py
(2.53 KB)
📄
__init__.pyc
(2.54 KB)
📄
__init__.pyo
(2.54 KB)
📄
_dummy.so
(4.06 KB)
📄
_internal.py
(17.84 KB)
📄
_internal.pyc
(16.34 KB)
📄
_internal.pyo
(16.34 KB)
📄
_methods.py
(4.21 KB)
📄
_methods.pyc
(4.79 KB)
📄
_methods.pyo
(4.79 KB)
📄
arrayprint.py
(25 KB)
📄
arrayprint.pyc
(23.4 KB)
📄
arrayprint.pyo
(23.4 KB)
📄
cversions.py
(413 B)
📄
cversions.pyc
(730 B)
📄
cversions.pyo
(730 B)
📄
defchararray.py
(66.26 KB)
📄
defchararray.pyc
(75.58 KB)
📄
defchararray.pyo
(75.58 KB)
📄
fromnumeric.py
(97.02 KB)
📄
fromnumeric.pyc
(100.34 KB)
📄
fromnumeric.pyo
(100.34 KB)
📄
function_base.py
(6.73 KB)
📄
function_base.pyc
(6.72 KB)
📄
function_base.pyo
(6.72 KB)
📄
generate_numpy_api.py
(7.24 KB)
📄
generate_numpy_api.pyc
(6.93 KB)
📄
generate_numpy_api.pyo
(6.93 KB)
📄
getlimits.py
(9.49 KB)
📄
getlimits.pyc
(10.83 KB)
📄
getlimits.pyo
(10.83 KB)
📁
include
📄
info.py
(4.58 KB)
📄
info.pyc
(4.83 KB)
📄
info.pyo
(4.83 KB)
📁
lib
📄
machar.py
(10.54 KB)
📄
machar.pyc
(8.66 KB)
📄
machar.pyo
(8.66 KB)
📄
memmap.py
(10.13 KB)
📄
memmap.pyc
(10.18 KB)
📄
memmap.pyo
(10.18 KB)
📄
multiarray.so
(1.52 MB)
📄
multiarray_tests.so
(48.04 KB)
📄
numeric.py
(86.66 KB)
📄
numeric.pyc
(89.99 KB)
📄
numeric.pyo
(89.89 KB)
📄
numerictypes.py
(28.11 KB)
📄
numerictypes.pyc
(27.55 KB)
📄
numerictypes.pyo
(27.51 KB)
📄
operand_flag_tests.so
(7.26 KB)
📄
records.py
(28.75 KB)
📄
records.pyc
(24.87 KB)
📄
records.pyo
(24.87 KB)
📄
setup.py
(40.04 KB)
📄
setup.pyc
(26.76 KB)
📄
setup.pyo
(26.76 KB)
📄
setup_common.py
(13.83 KB)
📄
setup_common.pyc
(11.31 KB)
📄
setup_common.pyo
(11.31 KB)
📄
shape_base.py
(8.84 KB)
📄
shape_base.pyc
(9.76 KB)
📄
shape_base.pyo
(9.76 KB)
📄
struct_ufunc_test.so
(7.3 KB)
📄
test_rational.so
(40.23 KB)
📁
tests
📄
umath.so
(705.3 KB)
📄
umath_tests.so
(14.87 KB)
Editing: _methods.py
""" Array methods which are called by both the C-code for the method and the Python code for the NumPy-namespace function """ from __future__ import division, absolute_import, print_function import warnings from numpy.core import multiarray as mu from numpy.core import umath as um from numpy.core.numeric import asanyarray from numpy.core import numerictypes as nt # save those O(100) nanoseconds! umr_maximum = um.maximum.reduce umr_minimum = um.minimum.reduce umr_sum = um.add.reduce umr_prod = um.multiply.reduce umr_any = um.logical_or.reduce umr_all = um.logical_and.reduce # avoid keyword arguments to speed up parsing, saves about 15%-20% for very # small reductions def _amax(a, axis=None, out=None, keepdims=False): return umr_maximum(a, axis, None, out, keepdims) def _amin(a, axis=None, out=None, keepdims=False): return umr_minimum(a, axis, None, out, keepdims) def _sum(a, axis=None, dtype=None, out=None, keepdims=False): return umr_sum(a, axis, dtype, out, keepdims) def _prod(a, axis=None, dtype=None, out=None, keepdims=False): return umr_prod(a, axis, dtype, out, keepdims) def _any(a, axis=None, dtype=None, out=None, keepdims=False): return umr_any(a, axis, dtype, out, keepdims) def _all(a, axis=None, dtype=None, out=None, keepdims=False): return umr_all(a, axis, dtype, out, keepdims) def _count_reduce_items(arr, axis): if axis is None: axis = tuple(range(arr.ndim)) if not isinstance(axis, tuple): axis = (axis,) items = 1 for ax in axis: items *= arr.shape[ax] return items def _mean(a, axis=None, dtype=None, out=None, keepdims=False): arr = asanyarray(a) rcount = _count_reduce_items(arr, axis) # Make this warning show up first if rcount == 0: warnings.warn("Mean of empty slice.", RuntimeWarning) # Cast bool, unsigned int, and int to float64 by default if dtype is None and issubclass(arr.dtype.type, (nt.integer, nt.bool_)): dtype = mu.dtype('f8') ret = umr_sum(arr, axis, dtype, out, keepdims) if isinstance(ret, mu.ndarray): ret = um.true_divide( ret, rcount, out=ret, casting='unsafe', subok=False) elif hasattr(ret, 'dtype'): ret = ret.dtype.type(ret / rcount) else: ret = ret / rcount return ret def _var(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False): arr = asanyarray(a) rcount = _count_reduce_items(arr, axis) # Make this warning show up on top. if ddof >= rcount: warnings.warn("Degrees of freedom <= 0 for slice", RuntimeWarning) # Cast bool, unsigned int, and int to float64 by default if dtype is None and issubclass(arr.dtype.type, (nt.integer, nt.bool_)): dtype = mu.dtype('f8') # Compute the mean. # Note that if dtype is not of inexact type then arraymean will # not be either. arrmean = umr_sum(arr, axis, dtype, keepdims=True) if isinstance(arrmean, mu.ndarray): arrmean = um.true_divide( arrmean, rcount, out=arrmean, casting='unsafe', subok=False) else: arrmean = arrmean.dtype.type(arrmean / rcount) # Compute sum of squared deviations from mean # Note that x may not be inexact and that we need it to be an array, # not a scalar. x = asanyarray(arr - arrmean) if issubclass(arr.dtype.type, nt.complexfloating): x = um.multiply(x, um.conjugate(x), out=x).real else: x = um.multiply(x, x, out=x) ret = umr_sum(x, axis, dtype, out, keepdims) # Compute degrees of freedom and make sure it is not negative. rcount = max([rcount - ddof, 0]) # divide by degrees of freedom if isinstance(ret, mu.ndarray): ret = um.true_divide( ret, rcount, out=ret, casting='unsafe', subok=False) elif hasattr(ret, 'dtype'): ret = ret.dtype.type(ret / rcount) else: ret = ret / rcount return ret def _std(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False): ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof, keepdims=keepdims) if isinstance(ret, mu.ndarray): ret = um.sqrt(ret, out=ret) elif hasattr(ret, 'dtype'): ret = ret.dtype.type(um.sqrt(ret)) else: ret = um.sqrt(ret) return ret
Upload File
Create Folder