ulab — numpy-compatible array library
ulab is a numpy-compatible numerical array library for MicroPython.
It provides the ndarray n-dimensional array type along with the
numpy and scipy submodules, which mirror a useful
subset of CPython’s numpy and scipy packages. Typical usage is
to import the submodules under their conventional aliases:
from ulab import numpy as np
from ulab import scipy as sp
The ndarray class itself is exposed both at the top level (as
ulab.ndarray) and through the numpy submodule (as
numpy.ndarray); both refer to the same type.
The optional user and utils submodules — present only when the
firmware was built with ULAB_HAS_USER_MODULE or
ULAB_HAS_UTILS_MODULE respectively — are not documented here.
Submodules
Classes
- class ulab.dtype(t: int | str | None = None)
Data-type descriptor for an
ndarray. Adtypeinstance carries one of the type codes'b'(bool),'B'(uint8),'b'(int8),'H'(uint16),'h'(int16),'f'/'d'(float) or'D'(complex), and is what is returned by thendarray.dtypeproperty.The constructor accepts either a single-character type code, one of the integer constants exposed by
numpy(numpy.uint8,numpy.int8,numpy.uint16,numpy.int16,numpy.float,numpy.bool, and – if the firmware was built with complex support –numpy.complex), or anotherdtypeinstance.When the firmware is built with
ULAB_HAS_DTYPE_OBJECTdisabled,ndarray.dtypereturns the underlying type-code integer directly instead of adtypeobject, and this class is not available.
The ndarray n-dimensional array class is documented under
numpy — numpy-compatible array operations.