hashval and Numpy

Emile van Sebille emile at fenx.com
Tue Oct 16 18:44:37 CEST 2001


How about:

>>> a
array([3, 4])
>>> `a`
'array([3, 4])'
>>> ky = `Numeric.array((3,4))`
>>> ky
'array([3, 4])'

Not ideal, but would work in a pinch.  ;-)

--

Emile van Sebille
emile at fenx.com

---------
"Uwe Schmitt" <uwe at rocksport.de> wrote in message
news:9qhksb$6raii$1 at hades.rz.uni-sb.de...
> Hi,
>
> I'd like to use a dictionary with NumericalPython-arrays as keys.
> This does not work, because NumPy does not provide hashvals for
> arrays. But this could be easyly done, as tupels are hashable.
> So: how can I extend NumPy, so that arrays get a hashval ???
>
> Greetings, Uwe.
>
> --
> Uwe.Schmitt at num.uni-sb.de      Universität des Saarlandes
> phone: +49 (0)681/302-2468     Geb. 36.1, Zi. 4.17, PF 151150
>                                D-66041  Saarbrücken
> http://www.rocksport.de        http://www.rocksport.de/first_ride.mp3
>




More information about the Python-list mailing list