示例#1
0
文件: Numeric.py 项目: IanReid/ABFGP
def put(a, ind, v):
    """put(a, ind, v) results in a[n] = v[n] for all n in ind
       If v is shorter than mask it will be repeated as necessary.
       In particular v can be a scalar or length 1 array.
       The routine put is the equivalent of the following (although the loop
       is in C for speed):

           ind = array(indices, copy=0)
           v = array(values, copy=0).astype(a, typecode())
           for i in ind: a.flat[i] = v[i]
       a must be a contiguous Numeric array.
    """
    multiarray.put(a, ind, array(v, copy=0).astype(a.typecode()))
示例#2
0
def put (a, ind, v):
    """put(a, ind, v) results in a[n] = v[n] for all n in ind
       If v is shorter than mask it will be repeated as necessary.
       In particular v can be a scalar or length 1 array.
       The routine put is the equivalent of the following (although the loop 
       is in C for speed): 

           ind = array(indices, copy=0) 
           v = array(values, copy=0).astype(a, typecode()) 
           for i in ind: a.flat[i] = v[i] 
       a must be a contiguous Numeric array.
    """
    multiarray.put (a, ind, array(v, copy=0).astype(a.typecode()))
示例#3
0
"""Numeric module defining a multi-dimensional array and useful procedures for
示例#4
0
"""Numeric module defining a multi-dimensional array and useful procedures for