[Numpy-discussion] fromfunction question

2007-08-08 Thread john saponara
Thinking I could use fromfunction to generate the x,y,z coordinates of a 3D surface, I instead got separate arrays of x, y, and z coordinates (as I should have expected) and needed to use a nested listcomp to produce the unified array of 3D points: x,y,z=fromfunction( lambda i,j: (xfun(i,j),yfu

[Numpy-discussion] spurious IndexError?

2007-08-07 Thread john saponara
Using numpy-1.0.2/python-2.5/winxp pro sp2: in the following, the only array is 'a', and I'm not using it as an index, so why do I get the IndexError below? --- start python session --- >>> a=array([[1,3],[2,4]]) >>> a array([[1, 3], [2, 4]]) >>> f=lambda i,j: a[i,j] >>> f(1,1) 4 >