package scipy

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Mmio.Coo_matrixSource

Sourcetype tag = [
  1. | `Coo_matrix
]
Sourcetype t = [ `ArrayLike | `Coo_matrix | `Object ] Obj.t
Sourceval of_pyobject : Py.Object.t -> t
Sourceval to_pyobject : [> tag ] Obj.t -> Py.Object.t
Sourceval create : ?shape:Py.Object.t -> ?dtype:Py.Object.t -> ?copy:Py.Object.t -> arg1:Py.Object.t -> unit -> t

A sparse matrix in COOrdinate format.

Also known as the 'ijv' or 'triplet' format.

This can be instantiated in several ways: coo_matrix(D) with a dense matrix D

coo_matrix(S) with another sparse matrix S (equivalent to S.tocoo())

coo_matrix((M, N), dtype) to construct an empty matrix with shape (M, N) dtype is optional, defaulting to dtype='d'.

coo_matrix((data, (i, j)), shape=(M, N)) to construct from three arrays: 1. data: the entries of the matrix, in any order 2. i: the row indices of the matrix entries 3. j: the column indices of the matrix entries

Where ``Ai[k], j[k] = datak``. When shape is not specified, it is inferred from the index arrays

Attributes ---------- dtype : dtype Data type of the matrix shape : 2-tuple Shape of the matrix ndim : int Number of dimensions (this is always 2) nnz Number of stored values, including explicit zeros data COO format data array of the matrix row COO format row index array of the matrix col COO format column index array of the matrix

Notes -----

Sparse matrices can be used in arithmetic operations: they support addition, subtraction, multiplication, division, and matrix power.

Advantages of the COO format

  • facilitates fast conversion among sparse formats
  • permits duplicate entries (see example)
  • very fast conversion to and from CSR/CSC formats

Disadvantages of the COO format

  • does not directly support:
  1. arithmetic operations
  2. slicing

Intended Usage

  • COO is a fast format for constructing sparse matrices
  • Once a matrix has been constructed, convert to CSR or CSC format for fast arithmetic and matrix vector operations
  • By default when converting to CSR or CSC format, duplicate (i,j) entries will be summed together. This facilitates efficient construction of finite element matrices and the like. (see example)

Examples --------

>>> # Constructing an empty matrix >>> from scipy.sparse import coo_matrix >>> coo_matrix((3, 4), dtype=np.int8).toarray() array([0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], dtype=int8)

>>> # Constructing a matrix using ijv format >>> row = np.array(0, 3, 1, 0) >>> col = np.array(0, 3, 1, 2) >>> data = np.array(4, 5, 7, 9) >>> coo_matrix((data, (row, col)), shape=(4, 4)).toarray() array([4, 0, 9, 0], [0, 7, 0, 0], [0, 0, 0, 0], [0, 0, 0, 5])

>>> # Constructing a matrix with duplicate indices >>> row = np.array(0, 0, 1, 3, 1, 0, 0) >>> col = np.array(0, 2, 1, 3, 1, 0, 0) >>> data = np.array(1, 1, 1, 1, 1, 1, 1) >>> coo = coo_matrix((data, (row, col)), shape=(4, 4)) >>> # Duplicate indices are maintained until implicitly or explicitly summed >>> np.max(coo.data) 1 >>> coo.toarray() array([3, 0, 1, 0], [0, 2, 0, 0], [0, 0, 0, 0], [0, 0, 0, 1])

Sourceval __iter__ : [> tag ] Obj.t -> Py.Object.t

None

Sourceval arcsin : [> tag ] Obj.t -> Py.Object.t

Element-wise arcsin.

See `numpy.arcsin` for more information.

Sourceval arcsinh : [> tag ] Obj.t -> Py.Object.t

Element-wise arcsinh.

See `numpy.arcsinh` for more information.

Sourceval arctan : [> tag ] Obj.t -> Py.Object.t

Element-wise arctan.

See `numpy.arctan` for more information.

Sourceval arctanh : [> tag ] Obj.t -> Py.Object.t

Element-wise arctanh.

See `numpy.arctanh` for more information.

Sourceval argmax : ?axis:[ `One | `Zero | `PyObject of Py.Object.t ] -> ?out:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Return indices of maximum elements along an axis.

Implicit zero elements are also taken into account. If there are several maximum values, the index of the first occurrence is returned.

Parameters ---------- axis :

2, -1, 0, 1, None

}

, optional Axis along which the argmax is computed. If None (default), index of the maximum element in the flatten data is returned. out : None, optional This argument is in the signature *solely* for NumPy compatibility reasons. Do not pass in anything except for the default value, as this argument is not used.

Returns ------- ind : numpy.matrix or int Indices of maximum elements. If matrix, its size along `axis` is 1.

Sourceval argmin : ?axis:[ `One | `Zero | `PyObject of Py.Object.t ] -> ?out:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Return indices of minimum elements along an axis.

Implicit zero elements are also taken into account. If there are several minimum values, the index of the first occurrence is returned.

Parameters ---------- axis :

2, -1, 0, 1, None

}

, optional Axis along which the argmin is computed. If None (default), index of the minimum element in the flatten data is returned. out : None, optional This argument is in the signature *solely* for NumPy compatibility reasons. Do not pass in anything except for the default value, as this argument is not used.

Returns ------- ind : numpy.matrix or int Indices of minimum elements. If matrix, its size along `axis` is 1.

Sourceval asformat : ?copy:bool -> format:[ `S of string | `None ] -> [> tag ] Obj.t -> Py.Object.t

Return this matrix in the passed format.

Parameters ---------- format : str, None The desired matrix format ('csr', 'csc', 'lil', 'dok', 'array', ...) or None for no conversion. copy : bool, optional If True, the result is guaranteed to not share data with self.

Returns ------- A : This matrix in the passed format.

Sourceval asfptype : [> tag ] Obj.t -> Py.Object.t

Upcast matrix to a floating point format (if necessary)

Sourceval astype : ?casting:[ `No | `Equiv | `Safe | `Same_kind | `Unsafe ] -> ?copy:bool -> dtype:[ `S of string | `Dtype of Np.Dtype.t ] -> [> tag ] Obj.t -> Py.Object.t

Cast the matrix elements to a specified type.

Parameters ---------- dtype : string or numpy dtype Typecode or data-type to which to cast the data. casting : 'no', 'equiv', 'safe', 'same_kind', 'unsafe', optional Controls what kind of data casting may occur. Defaults to 'unsafe' for backwards compatibility. 'no' means the data types should not be cast at all. 'equiv' means only byte-order changes are allowed. 'safe' means only casts which can preserve values are allowed. 'same_kind' means only safe casts or casts within a kind, like float64 to float32, are allowed. 'unsafe' means any data conversions may be done. copy : bool, optional If `copy` is `False`, the result might share some memory with this matrix. If `copy` is `True`, it is guaranteed that the result and this matrix do not share any memory.

Sourceval ceil : [> tag ] Obj.t -> Py.Object.t

Element-wise ceil.

See `numpy.ceil` for more information.

Sourceval conj : ?copy:bool -> [> tag ] Obj.t -> Py.Object.t

Element-wise complex conjugation.

If the matrix is of non-complex data type and `copy` is False, this method does nothing and the data is not copied.

Parameters ---------- copy : bool, optional If True, the result is guaranteed to not share data with self.

Returns ------- A : The element-wise complex conjugate.

Sourceval conjugate : ?copy:bool -> [> tag ] Obj.t -> Py.Object.t

Element-wise complex conjugation.

If the matrix is of non-complex data type and `copy` is False, this method does nothing and the data is not copied.

Parameters ---------- copy : bool, optional If True, the result is guaranteed to not share data with self.

Returns ------- A : The element-wise complex conjugate.

Sourceval copy : [> tag ] Obj.t -> Py.Object.t

Returns a copy of this matrix.

No data/indices will be shared between the returned value and current matrix.

Sourceval count_nonzero : [> tag ] Obj.t -> Py.Object.t

Number of non-zero entries, equivalent to

np.count_nonzero(a.toarray())

Unlike getnnz() and the nnz property, which return the number of stored entries (the length of the data attribute), this method counts the actual number of non-zero entries in data.

Sourceval deg2rad : [> tag ] Obj.t -> Py.Object.t

Element-wise deg2rad.

See `numpy.deg2rad` for more information.

Sourceval diagonal : ?k:int -> [> tag ] Obj.t -> Py.Object.t

Returns the kth diagonal of the matrix.

Parameters ---------- k : int, optional Which diagonal to get, corresponding to elements ai, i+k. Default: 0 (the main diagonal).

.. versionadded:: 1.0

See also -------- numpy.diagonal : Equivalent numpy function.

Examples -------- >>> from scipy.sparse import csr_matrix >>> A = csr_matrix([1, 2, 0], [0, 0, 3], [4, 0, 5]) >>> A.diagonal() array(1, 0, 5) >>> A.diagonal(k=1) array(2, 3)

Sourceval dot : other:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Ordinary dot product

Examples -------- >>> import numpy as np >>> from scipy.sparse import csr_matrix >>> A = csr_matrix([1, 2, 0], [0, 0, 3], [4, 0, 5]) >>> v = np.array(1, 0, -1) >>> A.dot(v) array( 1, -3, -1, dtype=int64)

Sourceval eliminate_zeros : [> tag ] Obj.t -> Py.Object.t

Remove zero entries from the matrix

This is an *in place* operation

Sourceval expm1 : [> tag ] Obj.t -> Py.Object.t

Element-wise expm1.

See `numpy.expm1` for more information.

Sourceval floor : [> tag ] Obj.t -> Py.Object.t

Element-wise floor.

See `numpy.floor` for more information.

Sourceval getH : [> tag ] Obj.t -> Py.Object.t

Return the Hermitian transpose of this matrix.

See Also -------- numpy.matrix.getH : NumPy's implementation of `getH` for matrices

Sourceval get_shape : [> tag ] Obj.t -> Py.Object.t

Get shape of a matrix.

Sourceval getcol : j:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Returns a copy of column j of the matrix, as an (m x 1) sparse matrix (column vector).

Sourceval getformat : [> tag ] Obj.t -> Py.Object.t

Format of a matrix representation as a string.

Sourceval getmaxprint : [> tag ] Obj.t -> Py.Object.t

Maximum number of elements to display when printed.

Sourceval getnnz : ?axis:[ `One | `Zero ] -> [> tag ] Obj.t -> Py.Object.t

Number of stored values, including explicit zeros.

Parameters ---------- axis : None, 0, or 1 Select between the number of values across the whole matrix, in each column, or in each row.

See also -------- count_nonzero : Number of non-zero entries

Sourceval getrow : i:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Returns a copy of row i of the matrix, as a (1 x n) sparse matrix (row vector).

Sourceval log1p : [> tag ] Obj.t -> Py.Object.t

Element-wise log1p.

See `numpy.log1p` for more information.

Sourceval max : ?axis:[ `One | `Zero | `PyObject of Py.Object.t ] -> ?out:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Return the maximum of the matrix or maximum along an axis. This takes all elements into account, not just the non-zero ones.

Parameters ---------- axis :

2, -1, 0, 1, None

}

optional Axis along which the sum is computed. The default is to compute the maximum over all the matrix elements, returning a scalar (i.e., `axis` = `None`).

out : None, optional This argument is in the signature *solely* for NumPy compatibility reasons. Do not pass in anything except for the default value, as this argument is not used.

Returns ------- amax : coo_matrix or scalar Maximum of `a`. If `axis` is None, the result is a scalar value. If `axis` is given, the result is a sparse.coo_matrix of dimension ``a.ndim - 1``.

See Also -------- min : The minimum value of a sparse matrix along a given axis. numpy.matrix.max : NumPy's implementation of 'max' for matrices

Sourceval maximum : other:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Element-wise maximum between this and another matrix.

Sourceval mean : ?axis:[ `One | `Zero | `PyObject of Py.Object.t ] -> ?dtype:Np.Dtype.t -> ?out:[> `Ndarray ] Np.Obj.t -> [> tag ] Obj.t -> [ `ArrayLike | `Ndarray | `Object ] Np.Obj.t

Compute the arithmetic mean along the specified axis.

Returns the average of the matrix elements. The average is taken over all elements in the matrix by default, otherwise over the specified axis. `float64` intermediate and return values are used for integer inputs.

Parameters ---------- axis :

2, -1, 0, 1, None

}

optional Axis along which the mean is computed. The default is to compute the mean of all elements in the matrix (i.e., `axis` = `None`). dtype : data-type, optional Type to use in computing the mean. For integer inputs, the default is `float64`; for floating point inputs, it is the same as the input dtype.

.. versionadded:: 0.18.0

out : np.matrix, optional Alternative output matrix in which to place the result. It must have the same shape as the expected output, but the type of the output values will be cast if necessary.

.. versionadded:: 0.18.0

Returns ------- m : np.matrix

See Also -------- numpy.matrix.mean : NumPy's implementation of 'mean' for matrices

Sourceval min : ?axis:[ `One | `Zero | `PyObject of Py.Object.t ] -> ?out:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Return the minimum of the matrix or maximum along an axis. This takes all elements into account, not just the non-zero ones.

Parameters ---------- axis :

2, -1, 0, 1, None

}

optional Axis along which the sum is computed. The default is to compute the minimum over all the matrix elements, returning a scalar (i.e., `axis` = `None`).

out : None, optional This argument is in the signature *solely* for NumPy compatibility reasons. Do not pass in anything except for the default value, as this argument is not used.

Returns ------- amin : coo_matrix or scalar Minimum of `a`. If `axis` is None, the result is a scalar value. If `axis` is given, the result is a sparse.coo_matrix of dimension ``a.ndim - 1``.

See Also -------- max : The maximum value of a sparse matrix along a given axis. numpy.matrix.min : NumPy's implementation of 'min' for matrices

Sourceval minimum : other:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Element-wise minimum between this and another matrix.

Sourceval multiply : other:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Point-wise multiplication by another matrix

Sourceval nonzero : [> tag ] Obj.t -> Py.Object.t

nonzero indices

Returns a tuple of arrays (row,col) containing the indices of the non-zero elements of the matrix.

Examples -------- >>> from scipy.sparse import csr_matrix >>> A = csr_matrix([1,2,0],[0,0,3],[4,0,5]) >>> A.nonzero() (array(0, 0, 1, 2, 2), array(0, 1, 2, 0, 2))

Sourceval power : ?dtype:Py.Object.t -> n:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

This function performs element-wise power.

Parameters ---------- n : n is a scalar

dtype : If dtype is not specified, the current dtype will be preserved.

Sourceval rad2deg : [> tag ] Obj.t -> Py.Object.t

Element-wise rad2deg.

See `numpy.rad2deg` for more information.

Sourceval reshape : ?kwargs:(string * Py.Object.t) list -> Py.Object.t list -> [> tag ] Obj.t -> [ `ArrayLike | `Object | `Spmatrix ] Np.Obj.t

reshape(self, shape, order='C', copy=False)

Gives a new shape to a sparse matrix without changing its data.

Parameters ---------- shape : length-2 tuple of ints The new shape should be compatible with the original shape. order : 'C', 'F', optional Read the elements using this index order. 'C' means to read and write the elements using C-like index order; e.g., read entire first row, then second row, etc. 'F' means to read and write the elements using Fortran-like index order; e.g., read entire first column, then second column, etc. copy : bool, optional Indicates whether or not attributes of self should be copied whenever possible. The degree to which attributes are copied varies depending on the type of sparse matrix being used.

Returns ------- reshaped_matrix : sparse matrix A sparse matrix with the given `shape`, not necessarily of the same format as the current object.

See Also -------- numpy.matrix.reshape : NumPy's implementation of 'reshape' for matrices

Sourceval resize : Py.Object.t list -> [> tag ] Obj.t -> Py.Object.t

Resize the matrix in-place to dimensions given by ``shape``

Any elements that lie within the new shape will remain at the same indices, while non-zero elements lying outside the new shape are removed.

Parameters ---------- shape : (int, int) number of rows and columns in the new matrix

Notes ----- The semantics are not identical to `numpy.ndarray.resize` or `numpy.resize`. Here, the same data will be maintained at each index before and after reshape, if that index is within the new bounds. In numpy, resizing maintains contiguity of the array, moving elements around in the logical matrix but not within a flattened representation.

We give no guarantees about whether the underlying data attributes (arrays, etc.) will be modified in place or replaced with new objects.

Sourceval rint : [> tag ] Obj.t -> Py.Object.t

Element-wise rint.

See `numpy.rint` for more information.

Sourceval set_shape : shape:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

See `reshape`.

Sourceval setdiag : ?k:int -> values:[> `Ndarray ] Np.Obj.t -> [> tag ] Obj.t -> Py.Object.t

Set diagonal or off-diagonal elements of the array.

Parameters ---------- values : array_like New values of the diagonal elements.

Values may have any length. If the diagonal is longer than values, then the remaining diagonal entries will not be set. If values if longer than the diagonal, then the remaining values are ignored.

If a scalar value is given, all of the diagonal is set to it.

k : int, optional Which off-diagonal to set, corresponding to elements ai,i+k. Default: 0 (the main diagonal).

Sourceval sign : [> tag ] Obj.t -> Py.Object.t

Element-wise sign.

See `numpy.sign` for more information.

Sourceval sin : [> tag ] Obj.t -> Py.Object.t

Element-wise sin.

See `numpy.sin` for more information.

Sourceval sinh : [> tag ] Obj.t -> Py.Object.t

Element-wise sinh.

See `numpy.sinh` for more information.

Sourceval sqrt : [> tag ] Obj.t -> Py.Object.t

Element-wise sqrt.

See `numpy.sqrt` for more information.

Sourceval sum : ?axis:[ `One | `Zero | `PyObject of Py.Object.t ] -> ?dtype:Np.Dtype.t -> ?out:[> `Ndarray ] Np.Obj.t -> [> tag ] Obj.t -> [ `ArrayLike | `Ndarray | `Object ] Np.Obj.t

Sum the matrix elements over a given axis.

Parameters ---------- axis :

2, -1, 0, 1, None

}

optional Axis along which the sum is computed. The default is to compute the sum of all the matrix elements, returning a scalar (i.e., `axis` = `None`). dtype : dtype, optional The type of the returned matrix and of the accumulator in which the elements are summed. The dtype of `a` is used by default unless `a` has an integer dtype of less precision than the default platform integer. In that case, if `a` is signed then the platform integer is used while if `a` is unsigned then an unsigned integer of the same precision as the platform integer is used.

.. versionadded:: 0.18.0

out : np.matrix, optional Alternative output matrix in which to place the result. It must have the same shape as the expected output, but the type of the output values will be cast if necessary.

.. versionadded:: 0.18.0

Returns ------- sum_along_axis : np.matrix A matrix with the same shape as `self`, with the specified axis removed.

See Also -------- numpy.matrix.sum : NumPy's implementation of 'sum' for matrices

Sourceval sum_duplicates : [> tag ] Obj.t -> Py.Object.t

Eliminate duplicate matrix entries by adding them together

This is an *in place* operation

Sourceval tan : [> tag ] Obj.t -> Py.Object.t

Element-wise tan.

See `numpy.tan` for more information.

Sourceval tanh : [> tag ] Obj.t -> Py.Object.t

Element-wise tanh.

See `numpy.tanh` for more information.

Sourceval toarray : ?order:Py.Object.t -> ?out:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

See the docstring for `spmatrix.toarray`.

Sourceval tobsr : ?blocksize:Py.Object.t -> ?copy:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Convert this matrix to Block Sparse Row format.

With copy=False, the data/indices may be shared between this matrix and the resultant bsr_matrix.

When blocksize=(R, C) is provided, it will be used for construction of the bsr_matrix.

Sourceval tocoo : ?copy:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Convert this matrix to COOrdinate format.

With copy=False, the data/indices may be shared between this matrix and the resultant coo_matrix.

Sourceval tocsc : ?copy:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Convert this matrix to Compressed Sparse Column format

Duplicate entries will be summed together.

Examples -------- >>> from numpy import array >>> from scipy.sparse import coo_matrix >>> row = array(0, 0, 1, 3, 1, 0, 0) >>> col = array(0, 2, 1, 3, 1, 0, 0) >>> data = array(1, 1, 1, 1, 1, 1, 1) >>> A = coo_matrix((data, (row, col)), shape=(4, 4)).tocsc() >>> A.toarray() array([3, 0, 1, 0], [0, 2, 0, 0], [0, 0, 0, 0], [0, 0, 0, 1])

Sourceval tocsr : ?copy:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Convert this matrix to Compressed Sparse Row format

Duplicate entries will be summed together.

Examples -------- >>> from numpy import array >>> from scipy.sparse import coo_matrix >>> row = array(0, 0, 1, 3, 1, 0, 0) >>> col = array(0, 2, 1, 3, 1, 0, 0) >>> data = array(1, 1, 1, 1, 1, 1, 1) >>> A = coo_matrix((data, (row, col)), shape=(4, 4)).tocsr() >>> A.toarray() array([3, 0, 1, 0], [0, 2, 0, 0], [0, 0, 0, 0], [0, 0, 0, 1])

Sourceval todense : ?order:[ `C | `F ] -> ?out:[ `Ndarray of [> `Ndarray ] Np.Obj.t | `T2_D of Py.Object.t ] -> [> tag ] Obj.t -> [> `ArrayLike ] Np.Obj.t

Return a dense matrix representation of this matrix.

Parameters ---------- order : 'C', 'F', optional Whether to store multi-dimensional data in C (row-major) or Fortran (column-major) order in memory. The default is 'None', indicating the NumPy default of C-ordered. Cannot be specified in conjunction with the `out` argument.

out : ndarray, 2-D, optional If specified, uses this array (or `numpy.matrix`) as the output buffer instead of allocating a new array to return. The provided array must have the same shape and dtype as the sparse matrix on which you are calling the method.

Returns ------- arr : numpy.matrix, 2-D A NumPy matrix object with the same shape and containing the same data represented by the sparse matrix, with the requested memory order. If `out` was passed and was an array (rather than a `numpy.matrix`), it will be filled with the appropriate values and returned wrapped in a `numpy.matrix` object that shares the same memory.

Sourceval todia : ?copy:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Convert this matrix to sparse DIAgonal format.

With copy=False, the data/indices may be shared between this matrix and the resultant dia_matrix.

Sourceval todok : ?copy:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Convert this matrix to Dictionary Of Keys format.

With copy=False, the data/indices may be shared between this matrix and the resultant dok_matrix.

Sourceval tolil : ?copy:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Convert this matrix to List of Lists format.

With copy=False, the data/indices may be shared between this matrix and the resultant lil_matrix.

Sourceval transpose : ?axes:Py.Object.t -> ?copy:bool -> [> tag ] Obj.t -> Py.Object.t

Reverses the dimensions of the sparse matrix.

Parameters ---------- axes : None, optional This argument is in the signature *solely* for NumPy compatibility reasons. Do not pass in anything except for the default value. copy : bool, optional Indicates whether or not attributes of `self` should be copied whenever possible. The degree to which attributes are copied varies depending on the type of sparse matrix being used.

Returns ------- p : `self` with the dimensions reversed.

See Also -------- numpy.matrix.transpose : NumPy's implementation of 'transpose' for matrices

Sourceval trunc : [> tag ] Obj.t -> Py.Object.t

Element-wise trunc.

See `numpy.trunc` for more information.

Sourceval dtype : t -> Np.Dtype.t

Attribute dtype: get value or raise Not_found if None.

Sourceval dtype_opt : t -> Np.Dtype.t option

Attribute dtype: get value as an option.

Sourceval shape : t -> Py.Object.t

Attribute shape: get value or raise Not_found if None.

Sourceval shape_opt : t -> Py.Object.t option

Attribute shape: get value as an option.

Sourceval ndim : t -> int

Attribute ndim: get value or raise Not_found if None.

Sourceval ndim_opt : t -> int option

Attribute ndim: get value as an option.

Sourceval nnz : t -> Py.Object.t

Attribute nnz: get value or raise Not_found if None.

Sourceval nnz_opt : t -> Py.Object.t option

Attribute nnz: get value as an option.

Sourceval data : t -> Py.Object.t

Attribute data: get value or raise Not_found if None.

Sourceval data_opt : t -> Py.Object.t option

Attribute data: get value as an option.

Sourceval row : t -> Py.Object.t

Attribute row: get value or raise Not_found if None.

Sourceval row_opt : t -> Py.Object.t option

Attribute row: get value as an option.

Sourceval col : t -> Py.Object.t

Attribute col: get value or raise Not_found if None.

Sourceval col_opt : t -> Py.Object.t option

Attribute col: get value as an option.

Sourceval to_string : t -> string

Print the object to a human-readable representation.

Sourceval show : t -> string

Print the object to a human-readable representation.

Sourceval pp : Format.formatter -> t -> unit

Pretty-print the object to a formatter.

OCaml

Innovation. Community. Security.