[Numpy-discussion] please comment on scalar types
haase at msg.ucsf.edu
Mon Aug 14 20:02:21 CDT 2006
I have a record array with a field 'mode'
Mode is a small integer that I use to choose a "PixelType"
So I did:
>>> print PixelTypes[ mode ]
TypeError: tuple indices must be integers
-> return PixelTypes[ mode ]
(Pdb) p mode
(Pdb) p type(mode)
(Pdb) p isinstance(mode, int)
Since numpy introduced special scalar types a simple statement like this
doesn't work anymore ! Would it work if int32scalar was derived from int ? I
actually thought it was ...
- Sebastian Haase
More information about the Numpy-discussion