Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Py.Array.of_indexed_structure getter setter length
returns a Python array-like structure a
of length length
, such that reading a[i]
returns getter i
and a[i] = v
calls setter i v
. To make the array-like structure read-only, raise an exception in setter
.
Py.Array.of_array getter setter array
returns a Python array-like structure accessing the elements of array
via getter
and setter
. To make the array-like structure read-only, raise an exception in setter
.
val numpy_api : unit -> Object.t
Returns the object which contains the entry points to the Numpy API. It is used internally by the following functions and by the Numpy
module.
val pyarray_type : unit -> Object.t
Returns the type of Numpy arrays.
val numpy : Stdcompat.floatarray -> Object.t
numpy a
returns a Numpy array that shares the same contents than the OCaml array a
. The array is passed in place (without copy) which relies on the unboxed representation of floatarray
: Python programs can change the contents of the array and the changes are visible in the OCaml array. Note that the Numpy
module provides a more general interface between Numpy arrays and OCaml bigarrays.
val numpy_get_array : Object.t -> Stdcompat.floatarray