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.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.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.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.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.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.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.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_repr()

numpy.array_repr(arr, max_line_width=None, precision=None, suppress_small=None) [source] Return the string representation of an array. Parameters: arr : ndarray Input array. max_line_width : int, optional The maximum number of columns the string should span. Newline characters split the string appropriately after array elements. precision : int, optional Floating point precision. Default is the current printing precision (usually 8), which can be altered using set_printoptions. suppr