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 5af2972 commit 4b1b9b8Copy full SHA for 4b1b9b8
pandas/core/dtypes/astype.py
@@ -126,8 +126,9 @@ def _astype_nansafe(
126
raise ValueError(msg)
127
128
if arr.dtype == object and dtype == bool:
129
- # If the dtype is bool and the array is object, we need to replace the False and True of the object type in the ndarray with the bool type
130
- # to ensure that the type conversion is correct
+ # If the dtype is bool and the array is object, we need to replace
+ # the False and True of the object type in the ndarray with the
131
+ # bool type to ensure that the type conversion is correct
132
arr[arr == "False"] = np.False_
133
arr[arr == "True"] = np.True_
134
return arr.astype(dtype, copy=copy)
0 commit comments