-
Notifications
You must be signed in to change notification settings - Fork 883
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
Mean ignore NaNs #379
Mean ignore NaNs #379
Conversation
gsheni
commented
Jan 22, 2019
•
edited
Loading
edited
- Modified the Mean primitive so it can be user controlled to ignore NaNs or not.
- Wrote simple test case to test the function.
Codecov Report
@@ Coverage Diff @@
## master #379 +/- ##
==========================================
+ Coverage 95.74% 95.79% +0.05%
==========================================
Files 89 89
Lines 7730 7751 +21
==========================================
+ Hits 7401 7425 +24
+ Misses 329 326 -3
Continue to review full report at Codecov.
|
mean_func = Mean().get_function() | ||
array = np.array([5, 5, 5, 5, 5]) | ||
assert mean_func(array) == 5 | ||
array = np.array([5, np.nan, np.nan, np.nan, np.nan, 10]) |
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.
you should add a test case where there are nans in the list, but ignore_nans=False
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.
Fixed.
Looks good to me! |