The recently proposed changes to the matrix class was the final push I needed to begin slowly porting my package from matrices to arrays. But I'm already stuck in the first stage (all new modules must use arrays).
Here's a toy example of iterating over columns of a matrix: x is a nxm matrix y is a nx1 matrix for j in xrange(x.shape[1]): idx = where(y > scalar)[0] x[idx,j] = scalar If x and y become 2d arrays, the code still works. But what confuses me is how to generalize it to work for both 2d and 1d arrays. _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion