rohdesamuel commented on a change in pull request #14327:
URL: https://github.com/apache/beam/pull/14327#discussion_r608994721
##########
File path: sdks/python/apache_beam/dataframe/frames_test.py
##########
@@ -526,13 +526,12 @@ def test_dataframe_cov_corr(self):
df = pd.DataFrame(np.random.randn(20, 3), columns=['a', 'b', 'c'])
df.loc[df.index[:5], 'a'] = np.nan
df.loc[df.index[5:10], 'b'] = np.nan
- self._run_test(lambda df: df.corr().round(8), df)
- self._run_test(lambda df: df.cov().round(8), df)
- self._run_test(lambda df: df.corr(min_periods=12).round(8), df)
- self._run_test(lambda df: df.cov(min_periods=12).round(8), df)
- self._run_test(lambda df: df.corrwith(df.a).round(8), df)
- self._run_test(
- lambda df: df[['a', 'b']].corrwith(df[['b', 'c']]).round(8), df)
+ self._run_test(lambda df: df.corr(), df)
+ self._run_test(lambda df: df.cov(), df)
+ self._run_test(lambda df: df.corr(min_periods=12), df)
+ self._run_test(lambda df: df.cov(min_periods=12), df)
+ self._run_test(lambda df: df.corrwith(df.a), df)
+ self._run_test(lambda df: df[['a', 'b']].corrwith(df[['b', 'c']]), df)
Review comment:
Because there is logic being modified for the Pearson correlation, can
you please add some tests ensuring commutativity between the order of the
columns?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]