[Numpy-discussion] fromiter + dtype='S' -> Python crash
Travis E. Oliphant
oliphant at enthought.com
Fri Mar 14 15:53:17 EDT 2008
Zbyszek Szmek wrote:
> On Thu, Mar 13, 2008 at 05:44:54PM -0400, Alan G Isaac wrote:
>
>> Looks like I misunderstood your question:
>> you want an **array** of strings?
>> In principle you should be able to use ``fromiter``,
>> I believe, but it does not work. BUG? (Crasher.)
>>
>>
>>>>> import numpy as N
>>>>> x = [1,2,3]
>>>>> fmt="%03d"
>>>>> N.fromiter([xi for xi in x],dtype='S')
>>>>>
>> Python crashes.
>>
>
>
>
> 2. what does dtype with dtype.elsize==0 mean? Should it be allowed at all?
> If it is sometimes valid, then PyArray_FromIter should be fixed.
>
It is a bug that needs to be fixed in PyArray_FromIter, I think.
-Travis O.
More information about the NumPy-Discussion
mailing list