I have some code, and what I would like it to do is this:
>> x=np.zeros((40,2))
>> x[31]=(12,15)
>> y=x.copy()
>> y[31]=(12,4)
#the following behavior is correct, but the syntax is unwieldy with the
#conversions to float and list, quite annoying
>> e=[12.,15.]
>> e in x.tolist()
True
>> e in y.tolist()
False
However, in the course of debugging I observed the following odd behavior:
>> e in x
True
>> e in y
True
even though
>> f=(8,93)
>> f in x
False
My question is twofold:
a) What is numpy doing here to produce this result?
b) Is there some way to accomplish this check other than using tolist
and float conversion as I have here (without using a python-level for loop)? This design is not obvious and not easily maintainable.