Skip to content

Commit d1548b0

Browse files
committed
made element iterable
1 parent 14daddf commit d1548b0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pandas/core/dtypes/cast.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
TimedeltaArray,
111111
)
112112

113-
114113
_int8_max = np.iinfo(np.int8).max
115114
_int16_max = np.iinfo(np.int16).max
116115
_int32_max = np.iinfo(np.int32).max
@@ -1920,7 +1919,7 @@ def np_can_hold_element(dtype: np.dtype, element: Any) -> Any:
19201919
return element
19211920
# GH 57338
19221921
# Check boolean array set as object type
1923-
comp = [lib.is_bool(e) for e in element]
1922+
comp = [lib.is_bool(e) for e in np.array([element]).flatten()]
19241923
if all(comp):
19251924
return element.astype("bool")
19261925
raise LossySetitemError

0 commit comments

Comments
 (0)