package np

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tag = [
  1. | `Ndenumerate
]
type t = [ `Ndenumerate | `Object ] Obj.t
val of_pyobject : Py.Object.t -> t
val to_pyobject : [> tag ] Obj.t -> Py.Object.t
val create : [> `Ndarray ] Obj.t -> t

Multidimensional index iterator.

Return an iterator yielding pairs of array coordinates and values.

Parameters ---------- arr : ndarray Input array.

See Also -------- ndindex, flatiter

Examples -------- >>> a = np.array([1, 2], [3, 4]) >>> for index, x in np.ndenumerate(a): ... print(index, x) (0, 0) 1 (0, 1) 2 (1, 0) 3 (1, 1) 4

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

None

val next : [> tag ] Obj.t -> int array * Py.Object.t

Standard iterator method, returns the index tuple and array value.

Returns ------- coords : tuple of ints The indices of the current iteration. val : scalar The array element of the current iteration.

val to_string : t -> string

Print the object to a human-readable representation.

val show : t -> string

Print the object to a human-readable representation.

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

Pretty-print the object to a formatter.

OCaml

Innovation. Community. Security.