[SciPy-user] array TypeError: expected a readable buffer object

BORGULYA Gábor borgulya@gyer2.sote...
Thu Sep 27 14:46:23 CDT 2007

Hi List!

Could someone explain me why I get an error message for the first 
expression and why no error for the second?

In [1]: import scipy

In [2]: a = scipy.array(['1','2','3',None,'4','5'])
exceptions.TypeError                                 Traceback (most recent 
call last)


TypeError: expected a readable buffer object

In [3]: a = scipy.array([1,2,3,None,4,5])

In [4]: a
Out[4]: array([1, 2, 3, None, 4, 5], dtype=object)

I expected that the first expression would evaluate as
array(['1', '2', '3', None, '4', '5'], dtype=object)
but it did not.

Please Cc my email address when replying to the list, thank you!


More information about the SciPy-user mailing list