All, I have a (m_1+1,m_2+1) matrix of 0 and 1, and I need to compute a second matrix U by recurrence. A double-loop as such #............................ U = empty((m_1+1, m_2+1)) U[:,0] = C[:,0] U[0,:] = C[0,:] for i in range(1,m_1+1): for j in range(1,m_2+1): U[i,j] = C[i,j] * (U[i,j-1] + U[i-1,j]) #............................ does the trick, but I suspect there is not a simpler, more elegant solution. Would anybody have any idea ? Thanks a lot in advance, and all my apologies for being a tad lazy...
(PS: FYI, it's for a reimplementation of the Kolmogorov-Smirnov test statistic, where ties occur) P. _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion