Skip to content

Commit

Permalink
BUG: Modify the comment format.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunlight798 committed Dec 7, 2024
1 parent 5af2972 commit 4b1b9b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pandas/core/dtypes/astype.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ def _astype_nansafe(
raise ValueError(msg)

if arr.dtype == object and dtype == bool:
# 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
# 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
# bool type to ensure that the type conversion is correct
arr[arr == "False"] = np.False_
arr[arr == "True"] = np.True_
return arr.astype(dtype, copy=copy)
Expand Down

0 comments on commit 4b1b9b8

Please sign in to comment.