[Numpy-discussion] Seg fault from numpy.rec.fromarrays

Dan Yamins dyamins@gmail....
Wed Mar 25 09:05:18 CDT 2009

> > Then I attempt
> >    >>> A = numpy.rec.fromarrays(L,names = ['Aggregates','__color__'])
> So what happens when you set the dtype here?

> Since you have variable lengths of strings, numpy probably has guessed
> incorrectly. I would also check that Col1 and Col2 are what you expect,
> especially the minimum lengths and really are strings.

These objects to indeed seem to by exactly what I expect.   The dtype
appears exactly to be right.   I had the same problem when I provided the
correct dtype by hand, and numpy seems to be guessing right when I don't.

Can you provide a small example that exhibits the problem?

Well that's the problem.  I can't easily.  The code that makes the example
that crashes is buried fairly deeply in some other routines.  When I try to
produce the proximate problem manually by creating what should (in theory)
be identical lists, at the interpreter prompt, I don't get the segfault

I've attached a .png picture of an short interpreter session where I show
the result of what is returned by the routines -- the object that causes
fault in its behavior, how its dtype seems right, and how pickling it solves
the problem.  If you can open attachments, perhaps looking at this would be

I know the problem must have something to do with the way the lists Col1 and
Col2 are getting created -- and that somehow, in a manner I don't understand
and is not readily apparent by i, they are not what I think they are.  But I
can't find out how they're wrong.   I was wondering if anybody had
encountered similar problems that might help me narrow my search.

I'm also willing to share all the code that leads up to the problem, if
that's the only way to identify the problem, although it would be a somewhat
laborious effort I think to subject you all to :)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090325/2b1f12d2/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Picture 4.png
Type: image/png
Size: 20501 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090325/2b1f12d2/attachment-0001.png 

More information about the Numpy-discussion mailing list