opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
numpy
/
typing
/
tests
/
data
/
reveal
➕ New
📤 Upload
✎ Editing:
ndarray_conversion.pyi
← Back
import numpy as np import numpy.typing as npt nd: npt.NDArray[np.int_] = np.array([[1, 2], [3, 4]]) # item reveal_type(nd.item()) # E: int reveal_type(nd.item(1)) # E: int reveal_type(nd.item(0, 1)) # E: int reveal_type(nd.item((0, 1))) # E: int # tolist reveal_type(nd.tolist()) # E: Any # itemset does not return a value # tostring is pretty simple # tobytes is pretty simple # tofile does not return a value # dump does not return a value # dumps is pretty simple # astype reveal_type(nd.astype("float")) # E: ndarray[Any, dtype[Any]] reveal_type(nd.astype(float)) # E: ndarray[Any, dtype[Any]] reveal_type(nd.astype(np.float64)) # E: ndarray[Any, dtype[{float64}]] reveal_type(nd.astype(np.float64, "K")) # E: ndarray[Any, dtype[{float64}]] reveal_type(nd.astype(np.float64, "K", "unsafe")) # E: ndarray[Any, dtype[{float64}]] reveal_type(nd.astype(np.float64, "K", "unsafe", True)) # E: ndarray[Any, dtype[{float64}]] reveal_type(nd.astype(np.float64, "K", "unsafe", True, True)) # E: ndarray[Any, dtype[{float64}]] # byteswap reveal_type(nd.byteswap()) # E: ndarray[Any, dtype[{int_}]] reveal_type(nd.byteswap(True)) # E: ndarray[Any, dtype[{int_}]] # copy reveal_type(nd.copy()) # E: ndarray[Any, dtype[{int_}]] reveal_type(nd.copy("C")) # E: ndarray[Any, dtype[{int_}]] reveal_type(nd.view()) # E: ndarray[Any, dtype[{int_}]] reveal_type(nd.view(np.float64)) # E: ndarray[Any, dtype[{float64}]] reveal_type(nd.view(float)) # E: ndarray[Any, dtype[Any]] reveal_type(nd.view(np.float64, np.matrix)) # E: matrix[Any, Any] # getfield reveal_type(nd.getfield("float")) # E: ndarray[Any, dtype[Any]] reveal_type(nd.getfield(float)) # E: ndarray[Any, dtype[Any]] reveal_type(nd.getfield(np.float64)) # E: ndarray[Any, dtype[{float64}]] reveal_type(nd.getfield(np.float64, 8)) # E: ndarray[Any, dtype[{float64}]] # setflags does not return a value # fill does not return a value
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel