Author steven.daprano
Recipients dcasmr, maheshwark97, mark.dickinson, steven.daprano
Date 2018-03-16.16:15:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20180316161508.GE16661@ando.pearwood.info>
In-reply-to <1521210756.02.0.467229070634.issue33084@psf.upfronthosting.co.za>
Content
On Fri, Mar 16, 2018 at 02:32:36PM +0000, Mark Dickinson wrote:
> For what it's worth, NumPy gives a result of NaN for the median of an array that contains NaNs:

By default, R gives the median of a list containing either NaN or NA 
("not available", intended as a missing value) as NA:

> median(c(1, 2, 3, 4, NA))
[1] NA
> median(c(1, 2, 3, 4, NaN))
[1] NA

but you can ignore them too:

> median(c(1, 2, 3, 4, NA), na.rm=TRUE)
[1] 2.5
> median(c(1, 2, 3, 4, NaN), na.rm=TRUE)
[1] 2.5
History
Date User Action Args
2018-03-16 16:15:15steven.dapranosetrecipients: + steven.daprano, mark.dickinson, maheshwark97, dcasmr
2018-03-16 16:15:15steven.dapranolinkissue33084 messages
2018-03-16 16:15:15steven.dapranocreate