Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

feat: add Series.cov method#368

Merged
gcf-merge-on-green[bot] merged 3 commits intomainfrom
cov
Feb 7, 2024
Merged

feat: add Series.cov method#368
gcf-merge-on-green[bot] merged 3 commits intomainfrom
cov

Conversation

@TrevorBergeron
Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Feb 6, 2024
@TrevorBergeron TrevorBergeron marked this pull request as ready for review February 6, 2024 00:34
@TrevorBergeron TrevorBergeron requested review from a team, Genesis929 and chelsea-lin February 6, 2024 00:34
Copy link
Copy Markdown
Contributor

@chelsea-lin chelsea-lin left a comment

Choose a reason for hiding this comment

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

LGTM. Can I add Dataframes.cov based on this commit?

left_numeric = cast(ibis_types.NumericColumn, left)
right_numeric = cast(ibis_types.NumericColumn, right)
bq_cov = _apply_window_if_present(
left_numeric.cov(right_numeric, how="sample"), window
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what's how='sample' meaning here? Do we calculate the cov based on a sample series?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sample variance often means it is population_variance * N / N-1. This provides an unbiased estimator of variance https://mathworld.wolfram.com/SampleVariance.html.

@TrevorBergeron TrevorBergeron added the automerge Merge the pull request once unit tests and other checks pass. label Feb 7, 2024
@gcf-merge-on-green gcf-merge-on-green bot merged commit 443db22 into main Feb 7, 2024
@gcf-merge-on-green gcf-merge-on-green bot deleted the cov branch February 7, 2024 21:18
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Feb 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants