ueshin commented on code in PR #52885:
URL: https://github.com/apache/spark/pull/52885#discussion_r2492878802
##########
python/pyspark/sql/pandas/group_ops.py:
##########
@@ -73,12 +73,12 @@ def apply(self, udf: "GroupedMapPandasUserDefinedFunction")
-> "DataFrame":
>>> df = spark.createDataFrame(
... [(1, 1.0), (1, 2.0), (2, 3.0), (2, 5.0), (2, 10.0)],
... ("id", "v"))
- >>> @pandas_udf("id long, v double", PandasUDFType.GROUPED_MAP) #
doctest: +SKIP
+ >>> @pandas_udf("id long, v double", PandasUDFType.GROUPED_MAP)
... def normalize(pdf):
... v = pdf.v
... return pdf.assign(v=(v - v.mean()) / v.std())
...
- >>> df.groupby("id").apply(normalize).show() # doctest: +SKIP
+ >>> df.groupby("id").apply(normalize).show()
Review Comment:
nit: we may want to sort to make the result stable?
--
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]