[Numpy-discussion] mean of empty sequence gives nan
Mon Sep 27 17:55:57 CDT 2010
On Mon, Sep 27, 2010 at 17:51, Peter Butterworth <email@example.com> wrote:
> In numpy 1.5.0, I got the following for mean of an empty sequence (or array):
> In : mean()
> Warning: invalid value encountered in double_scalars
> Out: nan
> Is this behaviour expected ?
np.sum() / len() -> 0.0 / 0 -> nan, so yes.
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the NumPy-Discussion