[SPARK-40510][PS] Implement ddof in Series.cov#37953
Closed
zhengruifeng wants to merge 2 commits intoapache:masterfrom
Closed
[SPARK-40510][PS] Implement ddof in Series.cov#37953zhengruifeng wants to merge 2 commits intoapache:masterfrom
ddof in Series.cov#37953zhengruifeng wants to merge 2 commits intoapache:masterfrom
Conversation
itholic
reviewed
Sep 21, 2022
python/pyspark/pandas/series.py
Outdated
| min_periods : int, optional | ||
| Minimum number of observations needed to have a valid result. | ||
| ddof : int, default 1 | ||
| Delta degrees of freedom. The divisor used in calculations |
Contributor
There was a problem hiding this comment.
nit: there are two spaces between sentences.
python/pyspark/pandas/series.py
Outdated
Comment on lines
1041
to
1043
| return sdf.select(SF.covar(F.col(sdf.columns[0]), F.col(sdf.columns[1]), ddof)).head(1)[ | ||
| 0 | ||
| ][0] |
Contributor
There was a problem hiding this comment.
Can we make it a bit more prettier?
e.g.
return sdf.select(
SF.covar(F.col(sdf.columns[0]), F.col(sdf.columns[1]), ddof)).head(1)[0][0]
Contributor
Author
There was a problem hiding this comment.
this was changed by dev/reformat-python...
Contributor
There was a problem hiding this comment.
Yeah, sometimes black reformats the code looking more ugly 😂
Comment on lines
+1025
to
+1026
| if not isinstance(ddof, int): | ||
| raise TypeError("ddof must be integer") |
Contributor
There was a problem hiding this comment.
Maybe do we need to add a negative test case?
Contributor
Author
There was a problem hiding this comment.
nice, willl update soon
Contributor
Author
|
also cc @HyukjinKwon |
HyukjinKwon
approved these changes
Sep 22, 2022
Contributor
Author
|
Merged into master, thank @HyukjinKwon @itholic for reivews! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
Implement
ddofinSeries.cov, by switch toSF.covarWhy are the changes needed?
for API coverage
Does this PR introduce any user-facing change?
yes,
ddofsupported nowHow was this patch tested?
added UT