numpy.asscalar()

numpy.asscalar(a) [source] Convert an array of size 1 to its scalar equivalent. Parameters: a : ndarray Input array of size 1. Returns: out : scalar Scalar representation of a. The output data type is the same type returned by the input?s item method. Examples >>> np.asscalar(np.array([24])) 24

numpy.asmatrix()

numpy.asmatrix(data, dtype=None) [source] Interpret the input as a matrix. Unlike matrix, asmatrix does not make a copy if the input is already a matrix or an ndarray. Equivalent to matrix(data, copy=False). Parameters: data : array_like Input data. dtype : data-type Data-type of the output matrix. Returns: mat : matrix data interpreted as a matrix. Examples >>> x = np.array([[1, 2], [3, 4]]) >>> m = np.asmatrix(x) >>> x[0,0] = 5 >>> m matrix

numpy.asfortranarray()

numpy.asfortranarray(a, dtype=None) [source] Return an array laid out in Fortran order in memory. Parameters: a : array_like Input array. dtype : str or dtype object, optional By default, the data-type is inferred from the input data. Returns: out : ndarray The input a in Fortran, or column-major, order. See also ascontiguousarray Convert input to a contiguous (C order) array. asanyarray Convert input to an ndarray with either row or column-major memory order. require Re

numpy.asfarray()

numpy.asfarray(a, dtype=) [source] Return an array converted to a float type. Parameters: a : array_like The input array. dtype : str or dtype object, optional Float type code to coerce input array a. If dtype is one of the ?int? dtypes, it is replaced with float64. Returns: out : ndarray The input a as a float ndarray. Examples >>> np.asfarray([2, 3]) array([ 2., 3.]) >>> np.asfarray([2, 3], dtype='float') array([ 2., 3.]) >>> np.asfarray([2, 3], dtyp

numpy.ascontiguousarray()

numpy.ascontiguousarray(a, dtype=None) [source] Return a contiguous array in memory (C order). Parameters: a : array_like Input array. dtype : str or dtype object, optional Data-type of returned array. Returns: out : ndarray Contiguous array of same shape and content as a, with type dtype if specified. See also asfortranarray Convert input to an ndarray with column-major memory order. require Return an ndarray that satisfies requirements. ndarray.flags Information about

numpy.asarray_chkfinite()

numpy.asarray_chkfinite(a, dtype=None, order=None) [source] Convert the input to an array, checking for NaNs or Infs. Parameters: a : array_like Input data, in any form that can be converted to an array. This includes lists, lists of tuples, tuples, tuples of tuples, tuples of lists and ndarrays. Success requires no NaNs or Infs. dtype : data-type, optional By default, the data-type is inferred from the input data. order : {?C?, ?F?}, optional Whether to use row-major (C-style) or col

numpy.asarray()

numpy.asarray(a, dtype=None, order=None) [source] Convert the input to an array. Parameters: a : array_like Input data, in any form that can be converted to an array. This includes lists, lists of tuples, tuples, tuples of tuples, tuples of lists and ndarrays. dtype : data-type, optional By default, the data-type is inferred from the input data. order : {?C?, ?F?}, optional Whether to use row-major (C-style) or column-major (Fortran-style) memory representation. Defaults to ?C?. Ret

numpy.asanyarray()

numpy.asanyarray(a, dtype=None, order=None) [source] Convert the input to an ndarray, but pass ndarray subclasses through. Parameters: a : array_like Input data, in any form that can be converted to an array. This includes scalars, lists, lists of tuples, tuples, tuples of tuples, tuples of lists, and ndarrays. dtype : data-type, optional By default, the data-type is inferred from the input data. order : {?C?, ?F?}, optional Whether to use row-major (C-style) or column-major (Fortran-

numpy.array_str()

numpy.array_str(a, max_line_width=None, precision=None, suppress_small=None) [source] Return a string representation of the data in an array. The data in the array is returned as a single string. This function is similar to array_repr, the difference being that array_repr also returns information on the kind of array and its data type. Parameters: a : ndarray Input array. max_line_width : int, optional Inserts newlines if text is longer than max_line_width. The default is, indirectly, 7

numpy.array_split()

numpy.array_split(ary, indices_or_sections, axis=0) [source] Split an array into multiple sub-arrays. Please refer to the split documentation. The only difference between these functions is that array_split allows indices_or_sections to be an integer that does not equally divide the axis. See also split Split array into multiple sub-arrays of equal size. Examples >>> x = np.arange(8.0) >>> np.array_split(x, 3) [array([ 0., 1., 2.]), array([ 3., 4., 5.]), array