Skip to content

Commit dbba7b4

Browse files
committed
replace to_numpy use with _data
1 parent a1bb9fc commit dbba7b4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pandas/core/tools/numeric.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ def to_numeric(arg, errors="raise", downcast=None):
155155
is_extension_array_dtype(arg) and isinstance(values, NumericArray)
156156
):
157157
is_numeric_extension_dtype = True
158-
mask = values._mask
159-
values = values.to_numpy()
160-
values[mask] = 0
158+
mask, values = values._mask, values._data
161159

162160
values_dtype = getattr(values, "dtype", None)
163161
if is_numeric_dtype(values_dtype):

0 commit comments

Comments
 (0)