On Mon, Sep 27, 2010 at 17:51, Peter Butterworth <[email protected]> wrote: > In numpy 1.5.0, I got the following for mean of an empty sequence (or array): > > In [21]: mean([]) > Warning: invalid value encountered in double_scalars > Out[21]: nan > > Is this behaviour expected ?
np.sum([]) / len([]) -> 0.0 / 0 -> nan, so yes. -- Robert Kern "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 _______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
