From: <vi...@id...> - 2002-04-17 22:24:41
|
# I'm running python 2.0 on Solaris and Numeric 21.0 #I have an m by n array -- called a and have # j an n long list of integers in range(m), such as j = argmax(a,0) # If I set z = zip(j,range(len(j))) # and try the statement res = take(a,z) # python appears to hang, but if I do res = array(map(lambda x,a=a: a[x[0],x[1]]],z) # It works. # Is there a simpler way of doing what I want, and why does take hang? # is it, perhaps, allocating some n by n work array (this would # probably make things thrash like crazy)? -- Victor S. Miller | " ... Meanwhile, those of us who can compute can hardly vi...@id... | be expected to keep writing papers saying 'I can do the CCR, Princeton, NJ | following useless calculation in 2 seconds', and indeed 08540 USA | what editor would publish them?" -- Oliver Atkin |