Github user brkyvz commented on a diff in the pull request:
https://github.com/apache/spark/pull/5858#discussion_r29557960
--- Diff: python/pyspark/sql/dataframe.py ---
@@ -875,6 +875,27 @@ def fillna(self, value, subset=None):
return DataFrame(self._jdf.na().fill(value,
self._jseq(subset)), self.sql_ctx)
+ def corr(self, col1, col2, method=None):
+ """
+ Calculates the correlation of two columns of a DataFrame as a
double value. Currently only
+ supports the Pearson Correlation Coefficient.
+ :func:`DataFrame.corr` and :func:`DataFrameStatFunctions.corr` are
aliases.
+
+ :param col1: The name of the first column
+ :param col2: The name of the second column
+ :param method: The correlation method. Currently only supports
"pearson"
+ """
+ if not isinstance(col1, str):
--- End diff --
If @rxin is okay with it, I can add those in a follow up PR for all the
methods that we added.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]