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

Fix divide by zero when calculating Means #706

Merged
merged 3 commits into from Mar 31, 2020
Merged

Fix divide by zero when calculating Means #706

merged 3 commits into from Mar 31, 2020

Conversation

Mr-F
Copy link

@Mr-F Mr-F commented Dec 29, 2017

When processing data, sometimes you end up with a column of null values. If this is then pushed into a pipeline of operations which include calculating the mean on that column, then the whole process errors out.

I've opted to return None in these situations. Originally, I planned to return '0' feeling it would be more in keeping with the expected data type from the mean operation. However, upon reflection, I think this would be a mistake as if the column normally contains '0' and '1' then it might be confusing and misleading.

Keith added 3 commits December 22, 2017 11:18
…ng about this some more it seems better to return a None value when there are no values to calculate a Mean of.
@Mr-F Mr-F mentioned this pull request Dec 29, 2017
lcorbasson added a commit to lcorbasson/agate that referenced this pull request Dec 5, 2019
@jpmckinney jpmckinney merged commit b2d1ebb into wireservice:master Mar 31, 2020
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

2 participants