-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
BUG: deprecation for ignored corrcoef args #5683
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1949,17 +1949,17 @@ def cov(m, y=None, rowvar=1, bias=0, ddof=None): | |
| return (dot(X, X.T.conj()) / fact).squeeze() | ||
|
|
||
|
|
||
| def corrcoef(x, y=None, rowvar=1, bias=0, ddof=None): | ||
| def corrcoef(x, y=None, rowvar=1, bias=np._NoValue, ddof=np._NoValue): | ||
| """ | ||
| Return correlation coefficients. | ||
| Return Pearson product-moment correlation coefficients. | ||
|
|
||
| Please refer to the documentation for `cov` for more detail. The | ||
| relationship between the correlation coefficient matrix, `P`, and the | ||
| relationship between the correlation coefficient matrix, `R`, and the | ||
| covariance matrix, `C`, is | ||
|
|
||
| .. math:: P_{ij} = \\frac{ C_{ij} } { \\sqrt{ C_{ii} * C_{jj} } } | ||
| .. math:: R_{ij} = \\frac{ C_{ij} } { \\sqrt{ C_{ii} * C_{jj} } } | ||
|
|
||
| The values of `P` are between -1 and 1, inclusive. | ||
| The values of `R` are between -1 and 1, inclusive. | ||
|
|
||
| Parameters | ||
| ---------- | ||
|
|
@@ -1975,28 +1975,33 @@ def corrcoef(x, y=None, rowvar=1, bias=0, ddof=None): | |
| variable, with observations in the columns. Otherwise, the relationship | ||
| is transposed: each column represents a variable, while the rows | ||
| contain observations. | ||
| bias : int, optional | ||
| Default normalization is by ``(N - 1)``, where ``N`` is the number of | ||
| observations (unbiased estimate). If `bias` is 1, then | ||
| normalization is by ``N``. These values can be overridden by using | ||
| the keyword ``ddof`` in numpy versions >= 1.5. | ||
| ddof : int, optional | ||
| .. versionadded:: 1.5 | ||
| If not ``None`` normalization is by ``(N - ddof)``, where ``N`` is | ||
| the number of observations; this overrides the value implied by | ||
| ``bias``. The default value is ``None``. | ||
| bias : _NoValue, optional | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should probably keep the documentation for both of these, but just say they have no affect and are deprecated. Like so
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make that |
||
| .. deprecated:: 1.10.0 | ||
| Has no affect, do not use. | ||
| ddof : _NoValue, optional | ||
| .. deprecated:: 1.10.0 | ||
| Has no affect, do not use. | ||
|
|
||
| Returns | ||
| ------- | ||
| out : ndarray | ||
| R : ndarray | ||
| The correlation coefficient matrix of the variables. | ||
|
|
||
| See Also | ||
| -------- | ||
| cov : Covariance matrix | ||
|
|
||
| Notes | ||
| ----- | ||
| This function accepts but discards arguments `bias` and `ddof`. This is | ||
| for backwards compatibility with previous versions of this function. These | ||
| arguments had no effect on the return values of the function and can be | ||
| safely ignored in this and previous versions of numpy. | ||
| """ | ||
| c = cov(x, y, rowvar, bias, ddof) | ||
| if bias is not np._NoValue or ddof is not np._NoValue: | ||
| warnings.warn('bias and ddof have no affect and are deprecated', | ||
| DeprecationWarning) | ||
| c = cov(x, y, rowvar) | ||
| try: | ||
| d = diag(c) | ||
| except ValueError: # scalar covariance | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two blank lines ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not export this publicly? Just call it _NoValue or something? We
have enough public clutter as it is, and this adds zero value.
On Mar 14, 2015 9:15 PM, "Charles Harris" [email protected] wrote:
In numpy/init.py
#5683 (comment):
Two blank lines ;)
—
Reply to this email directly or view it on GitHub
https://github.com/numpy/numpy/pull/5683/files#r26444409.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I guess it doesn't need to be public, so
_NoValuewould work.