package scipy

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

Module Sparse.BaseSource

Sourceval get_py : string -> Py.Object.t

Get an attribute of this module as a Py.Object.t. This is useful to pass a Python function to another function.

Sourcemodule SparseFormatWarning : sig ... end
Sourceval asmatrix : ?kwargs:(string * Py.Object.t) list -> Py.Object.t list -> Py.Object.t

None

Sourceval broadcast_to : ?subok:bool -> array:[> `Ndarray ] Np.Obj.t -> shape:Py.Object.t -> unit -> [ `ArrayLike | `Ndarray | `Object ] Np.Obj.t

Broadcast an array to a new shape.

Parameters ---------- array : array_like The array to broadcast. shape : tuple The shape of the desired array. subok : bool, optional If True, then sub-classes will be passed-through, otherwise the returned array will be forced to be a base-class array (default).

Returns ------- broadcast : array A readonly view on the original array with the given shape. It is typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location.

Raises ------ ValueError If the array is not compatible with the new shape according to NumPy's broadcasting rules.

Notes ----- .. versionadded:: 1.10.0

Examples -------- >>> x = np.array(1, 2, 3) >>> np.broadcast_to(x, (3, 3)) array([1, 2, 3], [1, 2, 3], [1, 2, 3])

Sourceval check_reshape_kwargs : Py.Object.t -> Py.Object.t

Unpack keyword arguments for reshape function.

This is useful because keyword arguments after star arguments are not allowed in Python 2, but star keyword arguments are. This function unpacks 'order' and 'copy' from the star keyword arguments (with defaults) and throws an error for any remaining.

Sourceval check_shape : ?current_shape:Py.Object.t -> args:Py.Object.t -> unit -> Py.Object.t

Imitate numpy.matrix handling of shape arguments

Sourceval get_sum_dtype : Py.Object.t -> Py.Object.t

Mimic numpy's casting for np.sum

None

Sourceval isintlike : Py.Object.t -> Py.Object.t

Is x appropriate as an index into a sparse matrix? Returns True if it can be cast safely to a machine int.

Sourceval isscalarlike : Py.Object.t -> Py.Object.t

Is x either a scalar, an array scalar, or a 0-dim array?

Sourceval issparse : Py.Object.t -> Py.Object.t

Is x of a sparse matrix type?

Parameters ---------- x object to check for being a sparse matrix

Returns ------- bool True if x is a sparse matrix, False otherwise

Notes ----- issparse and isspmatrix are aliases for the same function.

Examples -------- >>> from scipy.sparse import csr_matrix, isspmatrix >>> isspmatrix(csr_matrix([5])) True

>>> from scipy.sparse import isspmatrix >>> isspmatrix(5) False

Sourceval isspmatrix : Py.Object.t -> Py.Object.t

Is x of a sparse matrix type?

Parameters ---------- x object to check for being a sparse matrix

Returns ------- bool True if x is a sparse matrix, False otherwise

Notes ----- issparse and isspmatrix are aliases for the same function.

Examples -------- >>> from scipy.sparse import csr_matrix, isspmatrix >>> isspmatrix(csr_matrix([5])) True

>>> from scipy.sparse import isspmatrix >>> isspmatrix(5) False

Sourceval validateaxis : Py.Object.t -> Py.Object.t

None