To get the same behavior as in for lists, you could do something like this:
any(np.all(row == m2) for row in m1)
That does the loop over rows in python, which isn't ideal, but it should work.
To understand what's going on with the numpy in, here's a description of the semantics of in from Robert Kern on the numpy mailing list:
It dates back to Numeric's semantics for bool(some_array), which would
be True if any of the elements were nonzero. Just like any other
iterable container in Python, x in y will essentially do
for row in y:
if x == row:
return True
return False
Iterate along the first axis of y and compare by boolean equality. In
Numeric/numpy's case, this comparison is broadcasted. So that's why
[3,6,4] works, because there is one row where 3 is in the first
column. [4,2,345] doesn't work because the 4 and the 2 are not in
those columns.
Probably, this should be considered a mistake during the transition to
numpy's semantics of having bool(some_array) raise an exception.
scalar in array should probably work as-is for an ND array, but
there are several different possible semantics for array in array
that should be explicitly spelled out, much like bool(some_array).
m3 = [[1, 2, 3], [5, 4, 3]]in place ofm3 = [[1, 2, 3], [5, 3, 4]].