The wrappers of the array iterator API are deprecated, please use ndarray’s iterators like Lanes
and Zip
instead.
Expand description
Wrapper of the array iterator API.
This module exposes two iterators: NpySingleIter
and NpyMultiIter
.
As general recommendation, the usage of ndarray’s facilities for iteration should be preferred:
- They are more performant due to being transparent to the Rust compiler, using statically known dimensions
without dynamic dispatch into NumPy’s C implementation, c.f.
ndarray::iter::Iter
. - They are more flexible as to which parts of the array iterated in which order, c.f.
ndarray::iter::Lanes
. - They can zip up to six arrays together and operate on their elements using multiple threads, c.f.
ndarray::Zip
.
To safely use these types, extension functions should take PyReadonlyArray
as arguments
which provide the as_array
method to acquire an ndarray::ArrayView
.
Structs
An iterator over multiple arrays, construced by NpyMultiIterBuilder
.
Builder for NpyMultiIter
.
An iterator over a single array, construced by NpySingleIterBuilder
.
Builder of NpySingleIter
.
Represents the iterator mode where the last array is readonly.
Represents the iterator mode where the last array is readwrite.
Enums
Flags for constructing an iterator.
Traits
Iterator mode for single iterator
A combinator type that represents the mode of an iterator.
Represents the iterator mode where at least two arrays are iterated.