method
ndarray[shape, dtype]
Return a parametrized wrapper around the ndarray type.
New in version 1.22.
A parametrized ndarray type.
See also
Type hinting generics in standard collections.
numpy.typing.NDArrayAn ndarray alias generic w.r.t. its dtype.type.
>>> import numpy as np
>>> np.ndarray[tuple[int], np.dtype[np.uint8]] numpy.ndarray[tuple[int], numpy.dtype[numpy.uint8]]
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.ndarray.__class_getitem__.html