[Numpy-discussion] subtract.reduce behavior

Johann Hibschman jhibschman+numpy@gmail....
Thu Jul 22 16:15:25 CDT 2010


Pauli Virtanen <pav@iki.fi> writes:

> The documentation is incorrect.

Thanks.  The observed behavior is more like:

  if len(A) == 0:
    return op.identity
  else:
    r = A[0]
    for i in xrange(1, len(A):
      r = op(r, A[i])
    return r

-Johann



More information about the NumPy-Discussion mailing list