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 c3d6fc4 commit 380b410Copy full SHA for 380b410
pandas/core/dtypes/cast.py
@@ -1926,10 +1926,9 @@ def np_can_hold_element(dtype: np.dtype, element: Any) -> Any:
1926
# i.e. there are pd.NA elements
1927
raise LossySetitemError
1928
return element
1929
- # GH 57338
1930
- # Check boolean array set as object type
+ # GH 57338 check boolean array set as object type
1931
if tipo.kind == "O" and isinstance(element, np.ndarray):
1932
- if all(lib.is_bool(e) for e in element):
+ if lib.is_bool_array(element):
1933
return element.astype("bool")
1934
1935
0 commit comments