-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
Description
Pandas version checks
- I have checked that the issue still exists on the latest versions of the docs on
main
here
Location of the documentation
Documentation problem
The docstring for the to_numeric
function needs to be improved for clarity and accuracy. The current documentation states, "The default return dtype is float64 or int64," which can be misleading. This statement doesn't account for cases where the input data is already of a numeric ExtensionDtype (e.g., Int32, Float32, or Arrow dtypes where _is_numeric
is True
). In these instances, to_numeric
correctly preserves the original dtype rather than converting it, making the current documentation incomplete.
Suggested fix for documentation
- If the input is already of a numeric dtype, its dtype is preserved.
- The conversion to a default float64 or int64 dtype primarily applies to non-numeric inputs.