From 4d45ed48e2559f40ed6cb5b135d18bd64940ab18 Mon Sep 17 00:00:00 2001 From: Uddeshya Singh Date: Fri, 22 Jun 2018 10:10:15 +0530 Subject: [PATCH 1/4] Update numeric.py Specifying the default return types for `to_numeric` in case of no downcast --- pandas/core/tools/numeric.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index c584e29f682dd..6973233731625 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -43,6 +43,10 @@ def to_numeric(arg, errors='raise', downcast=None): checked satisfy that specification, no downcasting will be performed on the data. + Also Note that the default return dtype is `float64` or `int64` + depending on the data supplied.`downcast` for `float` or `int` + should only be used if output desired is `float32` or `int32` + .. versionadded:: 0.19.0 Returns From 4dcd860d489623e271c5e2b2aaa1142035daba4a Mon Sep 17 00:00:00 2001 From: Uddeshya Singh Date: Fri, 22 Jun 2018 14:21:10 +0530 Subject: [PATCH 2/4] Update numeric.py Adding the explanation in extended summary --- pandas/core/tools/numeric.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index 6973233731625..b686ac30b07f9 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -16,6 +16,9 @@ def to_numeric(arg, errors='raise', downcast=None): """ Convert argument to a numeric type. + The default return dtype is `float64` or `int64` depending on the data supplied. + Use the `downcast` parameter to obtain other dtypes. + Parameters ---------- arg : list, tuple, 1-d array, or Series @@ -43,10 +46,6 @@ def to_numeric(arg, errors='raise', downcast=None): checked satisfy that specification, no downcasting will be performed on the data. - Also Note that the default return dtype is `float64` or `int64` - depending on the data supplied.`downcast` for `float` or `int` - should only be used if output desired is `float32` or `int32` - .. versionadded:: 0.19.0 Returns From 0d2d3bc02532a54ee8479eb5a07e176c878ff6f8 Mon Sep 17 00:00:00 2001 From: Uddeshya Singh Date: Fri, 22 Jun 2018 14:22:30 +0530 Subject: [PATCH 3/4] Update numeric.py --- pandas/core/tools/numeric.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index b686ac30b07f9..830062763f54a 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -16,8 +16,9 @@ def to_numeric(arg, errors='raise', downcast=None): """ Convert argument to a numeric type. - The default return dtype is `float64` or `int64` depending on the data supplied. - Use the `downcast` parameter to obtain other dtypes. + The default return dtype is `float64` or `int64` + depending on the data supplied.Use the `downcast` parameter + to obtain other dtypes. Parameters ---------- From 1df5200bd7be1aa763854ec00d8d0280eb368683 Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Fri, 22 Jun 2018 06:05:21 -0400 Subject: [PATCH 4/4] typo --- pandas/core/tools/numeric.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index 830062763f54a..ebe135dfb184c 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -17,7 +17,7 @@ def to_numeric(arg, errors='raise', downcast=None): Convert argument to a numeric type. The default return dtype is `float64` or `int64` - depending on the data supplied.Use the `downcast` parameter + depending on the data supplied. Use the `downcast` parameter to obtain other dtypes. Parameters