def nonzero(): A = numeric.arange(1,3) assert A, 'A' B = numeric.empty((0,3)) assert not B, 'not B' C = numeric.array( 0. ) assert not C
def setdiff1d(): A = numeric.array([1,3,2,5] ) B = numeric.array([1,4,5] ) AB = numeric.setdiff1d( A, B ) assert AB.dtype == int assert numpy.equal( AB, [2,3] ).all()