Github user BryanCutler commented on a diff in the pull request:
https://github.com/apache/spark/pull/21471#discussion_r192257814
--- Diff: python/pyspark/sql/functions.py ---
@@ -2548,6 +2549,10 @@ def pandas_udf(f=None, returnType=None,
functionType=None):
| 2|6.0|
+---+---+
+ .. note:: If returning a new `pandas.DataFrame` constructed with a
dictionary, it is
+ recommended to explicitly index the columns by name to ensure
the positions are correct.
+ For example, `pd.DataFrame({'id': ids, 'a': data},
columns=['id', 'a'])`.
--- End diff --
yeah, probably a good idea to put in both places
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]