HyukjinKwon commented on a change in pull request #33882:
URL: https://github.com/apache/spark/pull/33882#discussion_r700717358
##########
File path: python/pyspark/pandas/namespace.py
##########
@@ -2747,13 +2747,23 @@ def merge(
@no_type_check
-def to_numeric(arg):
+def to_numeric(arg, errors="coerce"):
"""
Convert argument to a numeric type.
Parameters
----------
arg : scalar, list, tuple, 1-d array, or Series
+ Argument to be converted.
+ errors : {'ignore', 'raise', 'coerce'}, default 'coerce'
+ * If 'coerce', then invalid parsing will be set as NaN.
+ * If 'ignore', then invalid parsing will return the input.
+ * If 'raise', then invalid parsing will raise an exception.
Review comment:
also udpate the docs, and remove the ones in `Notes` to here.
##########
File path: python/pyspark/pandas/namespace.py
##########
@@ -2747,13 +2747,23 @@ def merge(
@no_type_check
-def to_numeric(arg):
+def to_numeric(arg, errors="coerce"):
"""
Convert argument to a numeric type.
Parameters
----------
arg : scalar, list, tuple, 1-d array, or Series
+ Argument to be converted.
+ errors : {'ignore', 'raise', 'coerce'}, default 'coerce'
+ * If 'coerce', then invalid parsing will be set as NaN.
+ * If 'ignore', then invalid parsing will return the input.
+ * If 'raise', then invalid parsing will raise an exception.
Review comment:
also udpate the docs, and move the ones in `Notes` to here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]