[Numpy-discussion] type 'numpy.int64' unhashable

David Cournapeau cournape at gmail.com
Fri Oct 30 07:21:16 EDT 2009


On Fri, Oct 30, 2009 at 8:04 PM, Sebastian Haase <seb.haase at gmail.com> wrote:

> I understand where this error comes from, however what I was trying to
> do seems to "intuitive" that I would like to ask for suggestions:
> "What should I do if the "number" 2636 becomes unhashable ?"

In your example, that's the array which is unhashable, the numbers
itself should be hashable. Arrays are mutable, so I don't think you
can easily make them hashable. You could transform everything into
tuple of tuple of... if you need to use set, though.

David



More information about the NumPy-Discussion mailing list