i have 2 2d arrays of same size a = array([[1,2],[3,4],[5,6]]) b = array([[1,2],[3,4],[7,8]]) i want know rows of b in a. so output should : array([ true, true, false], dtype=bool) without making : array([any(i == a) in b]) cause , b huge. there function 1d arrays : in1d what we'd use np.in1d ... except np.in1d works 1-dimensional arrays. our arrays multi-dimensional. however, can view arrays 1-dimensional array of strings : a = a.ravel().view((np.str, a.itemsize*a.shape[1])) for example, in [15]: = np.array([[1, 2], [2, 3], [1, 3]]) in [16]: = a.ravel().view((np.str, a.itemsize*a.shape[1])) in [17]: a.dtype out[17]: dtype('|s8') in [18]: a.shape out[18]: (3,) in [19]: out[19]: array(['\x01\x00\x00\x00\x02', '\x02\x00\x00\x00\x03', '\x01\x00\x00\x00\x03'], dtype='|s8') this makes each row of a string. matter of hooking np.in1d : def innd(a, b, assume_unique=false): = np.asarray...