We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14daddf commit d1548b0Copy full SHA for d1548b0
pandas/core/dtypes/cast.py
@@ -110,7 +110,6 @@
110
TimedeltaArray,
111
)
112
113
-
114
_int8_max = np.iinfo(np.int8).max
115
_int16_max = np.iinfo(np.int16).max
116
_int32_max = np.iinfo(np.int32).max
@@ -1920,7 +1919,7 @@ def np_can_hold_element(dtype: np.dtype, element: Any) -> Any:
1920
1919
return element
1921
# GH 57338
1922
# Check boolean array set as object type
1923
- comp = [lib.is_bool(e) for e in element]
+ comp = [lib.is_bool(e) for e in np.array([element]).flatten()]
1924
if all(comp):
1925
return element.astype("bool")
1926
raise LossySetitemError
0 commit comments