Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/1878#discussion_r16337343
--- Diff: python/pyspark/mllib/stat.py ---
@@ -119,15 +119,15 @@ def corr(x, y=None, method=None):
>>> rdd = sc.parallelize([Vectors.dense([1, 0, 0, -2]),
Vectors.dense([4, 5, 0, 3]),
... Vectors.dense([6, 7, 0, 8]),
Vectors.dense([9, 0, 0, 1])])
>>> Statistics.corr(rdd)
- array([[ 1. , 0.05564149, nan, 0.40047142],
- [ 0.05564149, 1. , nan, 0.91359586],
- [ nan, nan, 1. , nan],
- [ 0.40047142, 0.91359586, nan, 1. ]])
+ array([[ 1. , 0.05564149, NaN, 0.40047142],
--- End diff --
I'm using 2.7.7 but using `NaN` will result an error in my local test.
Maybe we should check the elements one by one in this case and use `isnan` on
`NaN` values.
---
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]