A slightly related question on this topic... Is there a good loopless way to identify all of the unique rows in an array? Something like numpy.unique() is ideal, but capable of extracting unique subarrays along an axis.
Thanks, -Mark mark wrote: > Maybe this is not the intended use of where, but it seems to work: >>>> from numpy import * # No complaining now >>>> a = arange(12) >>>> a.shape = (4,3) >>>> a > array([[ 0, 1, 2], > [ 3, 4, 5], > [ 6, 7, 8], > [ 9, 10, 11]]) >>>> b = array([6,7,8]) >>>> row = all( equal(a,b), 1 ) >>>> where(row==True) > (array([2]),) > _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
