From 152c1ed4f26e0eb2e597ca891d9650b91af1bbdd Mon Sep 17 00:00:00 2001 From: Jay <2594jaypatel@gmail.com> Date: Tue, 15 Jul 2025 19:10:00 -0400 Subject: [PATCH 1/2] DOC: Add Raises section to to_numeric docstring --- pandas/core/tools/numeric.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index bc45343d6e2d3..8c43708feff1d 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -114,6 +114,13 @@ def to_numeric( Numeric if parsing succeeded. Return type depends on input. Series if Series, otherwise ndarray. + Raises + ------ + ValueError + If the input contains non-numeric values and `errors='raise'`. + TypeError + If the input is not list-like, 1D, or scalar convertible to numeric, + such as nested lists or unsupported input types (e.g., dict). See Also -------- DataFrame.astype : Cast argument to a specified dtype. From 89c7ff308e88ea776d61cb35842e8c3edb8097a5 Mon Sep 17 00:00:00 2001 From: Jay <2594jaypatel@gmail.com> Date: Tue, 15 Jul 2025 19:54:23 -0400 Subject: [PATCH 2/2] DOC: Fix See Also formatting in to_numeric --- pandas/core/tools/numeric.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index 8c43708feff1d..c2ffe17adbac5 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -121,6 +121,7 @@ def to_numeric( TypeError If the input is not list-like, 1D, or scalar convertible to numeric, such as nested lists or unsupported input types (e.g., dict). + See Also -------- DataFrame.astype : Cast argument to a specified dtype.