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

Return NaN for median of vectors containing NaN. Closes #6486 #6820

Merged
merged 1 commit into from
May 12, 2014

Conversation

simonster
Copy link
Member

This seemed to be the consensus, so I'll merge tomorrow unless there is a complaint.

checknan && any(isnan,v) && error("median of an array with NaNs is undefined")
if checknan
for x in v
isnan(x) && return nan(T)
Copy link
Member

Choose a reason for hiding this comment

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

It would be better to just return x.

Copy link
Member Author

Choose a reason for hiding this comment

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

True.

StefanKarpinski added a commit that referenced this pull request May 12, 2014
Return NaN for median of vectors containing NaN. Closes #6486
@StefanKarpinski StefanKarpinski merged commit 69d381a into master May 12, 2014
@StefanKarpinski StefanKarpinski deleted the sjk/median_nan branch May 12, 2014 18:28
simonster added a commit that referenced this pull request Oct 7, 2014
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.

2 participants