I assume that, because NaN != NaN, even though both have the same hash value (hash(NaN) == -32768), that Python treats any NaN double as a distinct key in a dictionary.
In [76]: a = np.repeat(nan, 10) In [77]: d = {} In [78]: for i, v in enumerate(a): ....: d[v] = i ....: ....: In [79]: d Out[79]: {nan: 0, nan: 1, nan: 6, nan: 4, nan: 3, nan: 9, nan: 7, nan: 2, nan: 8, nan: 5} I'm not sure if this ever worked in a past version of NumPy, however, I have code which does a "group by value" and occasionally in the real world those values are NaN. Any ideas or a way around this problem? Thanks, Wes
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion