You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there is a bug in ndarray type hint.
I think that in case of np.array that has one row with only integers (type int or int[64]) and one row with at least one float (e.g. type float), then it produces an error since rows have different types so conflict like "np.ndarray[float] != np.ndarray[int]" occurs.
bug.py:3: error: Argument 1 to "array" has incompatible type "List[object]"; expected "Union[List[bool], List[List[bool]], List[List[List[bool]]], List[List[List[List[bool]]]]]"
I think there is a bug in ndarray type hint.
I think that in case of np.array that has one row with only integers (type
intorint[64]) and one row with at least one float (e.g. typefloat), then it produces an error since rows have different types so conflict like "np.ndarray[float] != np.ndarray[int]" occurs.Reproducing code example:
and run mypy:
Error message:
bug.py:3: error: Argument 1 to "array" has incompatible type "List[object]"; expected "Union[List[bool], List[List[bool]], List[List[List[bool]]], List[List[List[List[bool]]]]]"
NumPy/Python/data-science-types versions information:
1.19.2 / 3.8.5 / 0.2.20