anishmehta24 opened a new pull request, #41140: URL: https://github.com/apache/beam/pull/41140
Fixes #41139 `DataFrame.cov` computed the diagonal as `self[col].std(ddof)` squared, so `ddof` went to `axis` and `min_periods` was ignored there. It now uses `_cov_aligned` on the column's non-null values, like the off-diagonal entries. `DataFrame.corr` set the diagonal to 1.0; it is now NaN when the column has fewer than `min_periods` values or no variance, as in pandas. `Series.corr` of a constant series returned a `ZeroDivisionError` and now gives NaN. Added `test_dataframe_cov_corr_diagonal` and `test_corr_no_variance` (both fail on master). frames_test.py and pandas_doctests_test.py pass. When the frame has NaNs pandas ignores `ddof` entirely; Beam already applied it to the off-diagonal entries there, and now applies it to the diagonal too. -- 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]
