Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
ndarray.pyi12 linesDownload Raw Back to fail
1import numpy as np
2
3# Ban setting dtype since mutating the type of the array in place
4# makes having ndarray be generic over dtype impossible. Generally
5# users should use `ndarray.view` in this situation anyway. See
6#
7# https://github.com/numpy/numpy-stubs/issues/7
8#
9# for more context.
10float_array = np.array([1.0])
11float_array.dtype = np.bool  # type: ignore[assignment, misc]
12 
codekingpro/portable-devtools · Team Ai