Skip to content

CLN: Use to_numpy directly in cov / corr #34031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
May 23, 2020
Merged

CLN: Use to_numpy directly in cov / corr #34031

merged 39 commits into from
May 23, 2020

Conversation

dsaxton
Copy link
Member

@dsaxton dsaxton commented May 6, 2020

No description provided.

dsaxton and others added 29 commits April 28, 2020 20:26
Otherwise this can raise for an all integer DataFrame without
any missing values
Co-authored-by: Joris Van den Bossche <[email protected]>
Co-authored-by: Joris Van den Bossche <[email protected]>
@dsaxton dsaxton added the Clean label May 7, 2020
@dsaxton dsaxton marked this pull request as ready for review May 13, 2020 15:56
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm @jreback

@WillAyd WillAyd added this to the 1.1 milestone May 20, 2020
@@ -7973,7 +7973,7 @@ def corr(self, method="pearson", min_periods=1) -> "DataFrame":
numeric_df = self._get_numeric_data()
cols = numeric_df.columns
idx = cols.copy()
mat = numeric_df.astype(float, copy=False).to_numpy()
mat = numeric_df.to_numpy(dtype=float, na_value=np.nan)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have copy=False by default in .to_numpy()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but I can make this explicit

@jorisvandenbossche jorisvandenbossche merged commit 833ce28 into pandas-dev:master May 23, 2020
@dsaxton dsaxton deleted the to_numpy-corr branch May 23, 2020 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants