package scipy

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

Module Sparse.SputilsSource

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.

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

None

Sourceval bmat : ?kwargs:(string * Py.Object.t) list -> Py.Object.t list -> Py.Object.t

None

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 downcast_intp_index : Py.Object.t -> Py.Object.t

Down-cast index array to np.intp dtype if it is of a larger dtype.

Raise an error if the array contains a value that is too large for intp.

Sourceval get_index_dtype : ?arrays:Py.Object.t -> ?maxval:float -> ?check_contents:bool -> unit -> Np.Dtype.t

Based on input (integer) arrays `a`, determine a suitable index data type that can hold the data in the arrays.

Parameters ---------- arrays : tuple of array_like Input arrays whose types/contents to check maxval : float, optional Maximum value needed check_contents : bool, optional Whether to check the values in the arrays and not just their types. Default: False (check only the types)

Returns ------- dtype : dtype Suitable index data type (int32 or int64)

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

Mimic numpy's casting for np.sum

Sourceval getdtype : ?a:Py.Object.t -> ?default:Py.Object.t -> dtype:Py.Object.t -> unit -> Py.Object.t

Function used to simplify argument processing. If 'dtype' is not specified (is None), returns a.dtype; otherwise returns a np.dtype object created from the specified dtype argument. If 'dtype' and 'a' are both None, construct a data type out of the 'default' parameter. Furthermore, 'dtype' must be in 'allowed' set.

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

Check whether object is pydata/sparse matrix, avoiding importing the module.

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 ismatrix : Py.Object.t -> Py.Object.t

None

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

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

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

None

Sourceval isshape : ?nonneg:Py.Object.t -> x:Py.Object.t -> unit -> Py.Object.t

Is x a valid 2-tuple of dimensions?

If nonneg, also checks that the dimensions are non-negative.

Sourceval matrix : ?kwargs:(string * Py.Object.t) list -> Py.Object.t list -> Py.Object.t

None

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

None

Sourceval upcast : Py.Object.t list -> Py.Object.t

Returns the nearest supported sparse dtype for the combination of one or more types.

upcast(t0, t1, ..., tn) -> T where T is a supported dtype

Examples --------

>>> upcast('int32') <type 'numpy.int32'> >>> upcast('bool') <type 'numpy.bool_'> >>> upcast('int32','float32') <type 'numpy.float64'> >>> upcast('bool',complex,float) <type 'numpy.complex128'>

Sourceval upcast_char : Py.Object.t list -> Py.Object.t

Same as `upcast` but taking dtype.char as input (faster).

Sourceval upcast_scalar : dtype:Py.Object.t -> scalar:Py.Object.t -> unit -> Py.Object.t

Determine data type for binary operation between an array of type `dtype` and a scalar.

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

None