package scipy

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val 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.

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

Imitate numpy.matrix handling of shape arguments

val 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)

val 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.

val 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.

val 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

val isspmatrix_bsr : Py.Object.t -> Py.Object.t

Is x of a bsr_matrix type?

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

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

Examples -------- >>> from scipy.sparse import bsr_matrix, isspmatrix_bsr >>> isspmatrix_bsr(bsr_matrix([5])) True

>>> from scipy.sparse import bsr_matrix, csr_matrix, isspmatrix_bsr >>> isspmatrix_bsr(csr_matrix([5])) False

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

None

val 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'>

val warn : ?category:Py.Object.t -> ?stacklevel:Py.Object.t -> ?source:Py.Object.t -> message:Py.Object.t -> unit -> Py.Object.t

Issue a warning, or maybe ignore it or raise an exception.

OCaml

Innovation. Community. Security.