[Numpy-tickets] [NumPy] #559: var() on a size=1 array should raise exception.
NumPy
numpy-tickets@scipy....
Tue Jul 31 01:56:01 CDT 2007
#559: var() on a size=1 array should raise exception.
--------------------+-------------------------------------------------------
Reporter: gpk | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone:
Component: Other | Version: none
Severity: normal | Resolution:
Keywords: |
--------------------+-------------------------------------------------------
Comment (by cdavid):
Well, if you want to be picky, var is not the variance, but the estimated
variance. In numpy, var and std are biased, so at least their formula
makes sense.
I tried on matlab, octave and R: the first two give back 0, the latter
gives back NA, which is not that surprising giving the focus of each. It
all depends on which context var and std are used in: maybe they are not
used in a statistical context ? I would say that the current behaviour for
a general purpose scientific environment makes sense.
--
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/559#comment:1>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.
More information about the Numpy-tickets
mailing list