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

series.Mean() returns NaN when any element in a series of floats is NaN #114

Open
evanmcclure opened this issue Feb 6, 2020 · 4 comments

Comments

@evanmcclure
Copy link

I was exploring a dataset and discovered that when any element in a Series of floats is NaN, the function called series.Mean() invalidates the entire series and returns NaN. I expected series.Mean() to exclude values with NaN when computing the mean.

@evanmcclure
Copy link
Author

I believe the fix should happen within series.Float(), perhaps using another version of series.Float() lets the user exclude NaN values, before the slice ever gets passed to gonum. I believe the other statistical functions in Series should also have the same behavior. That is, exclude NaN values in the series.

@evanmcclure
Copy link
Author

I'll clone and submit a PR for this change. Then, you can let me know if you think this is worthwhile.

@dalizitajiu
Copy link

I'll clone and submit a PR for this change. Then, you can let me know if you think this is worthwhile.

has this pr merged to master branch?

@salahuiste
Copy link

@dalizitajiu same question

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

No branches or pull requests

3 participants