[SciPy-user] dtype

Maik Trömel maik.troemel at maitro.net
Mon Jun 12 12:19:29 EDT 2006


Hello list,

i've got a question concerning datatypes.
I'm importing a file filled with Data with the lenght of 2 bytes via

arrh = numpy.fromstring(radFile, dtype = 'S2', count = 900*900)

Now I want to convert the data via

value = ord(arr[n][m][0]) * 256 + ord(arr[n][m][1])

But if the value in the array is NULL i get an Error:

IndexError: string index out of range

So I think I have to choose another dtype. But I don't have any idea 
which one.
Probably someone has an idea.

Thanks for support.

Greetings
Maik




More information about the SciPy-User mailing list