Skip to content
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

ENH: A new accessor weighted_mean for DataFrame #688

Merged
merged 55 commits into from Sep 29, 2022

Conversation

Zeroto521
Copy link
Owner

@Zeroto521 Zeroto521 commented Aug 30, 2022

  • closes #xxxx
  • whatsnew entry

an accessor to achieve a weighted mean

    >>> import dtoolkit.accessor
    >>> import pandas as pd
    >>> df = pd.DataFrame({"a": [1, 1], "b": [2, 2], "c": [4, 4]})
    >>> df
       a  b  c
    0  1  2  4
    1  1  2  4
    >>> df.weighted_mean([0, 5, 5])
    0    3.0
    1    3.0
    dtype: float64

@Zeroto521 Zeroto521 changed the title Accessor/weighted score ENH: A new accessor weighted_score for DataFrame Aug 30, 2022
@codecov
Copy link

codecov bot commented Aug 30, 2022

Codecov Report

Merging #688 (470bea3) into main (6f0f7a9) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #688      +/-   ##
==========================================
+ Coverage   99.43%   99.45%   +0.01%     
==========================================
  Files         109      110       +1     
  Lines        1418     1461      +43     
  Branches      147      160      +13     
==========================================
+ Hits         1410     1453      +43     
  Misses          2        2              
  Partials        6        6              
Impacted Files Coverage Δ
dtoolkit/accessor/dataframe/weighted_mean.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Zeroto521 Zeroto521 changed the title ENH: A new accessor weighted_score for DataFrame ENH: A new accessor weighted_mean for DataFrame Sep 29, 2022
@Zeroto521 Zeroto521 merged commit 9ce196c into main Sep 29, 2022
@Zeroto521 Zeroto521 deleted the accessor/weighted_score branch September 29, 2022 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant