[PYTHON MATRIX-SIG] Another problem?

tim@lassi.ece.uiuc.edu tim@lassi.ece.uiuc.edu
Fri, 16 Aug 1996 09:56:13 -0500


I was about to send some mail myself about the non-zero problem. I
tracked it down in the numeric library and it looks like,

def nonzero(a):
    """Return the indices of the elements of a which are not zero, a
must be 1d
    """
    return repeat(arange(len(a)), a)

should be:

def nonzero(a):
    """Return the indices of the elements of a which are not zero, a
must be 1d
    """
    return repeat(arange(len(a)), nonZero(a))

At least that gives the behaviour I expect.

-- 
	-tim

+--------------------------------------------------------------------+
| Tim Hochberg               Ultrahigh Speed Digital Electronics Lab |
| tim@lassi.ece.uiuc.edu              University of Illinois         |
| http://dogbert.ece.uiuc.edu/~tim         (217) 333-6014            |
+--------------------------------------------------------------------+

=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================