[Numpy-discussion] Bug

Sasha ndarray at mac.com
Fri Apr 28 10:04:08 CDT 2006


See <http://projects.scipy.org/scipy/numpy/ticket/86>.

On 4/28/06, Sasha <ndarray at mac.com> wrote:
> The core dump is definitely a bug.  I reproduced it on my Linux
> system.  Please create a ticket.  I am not sure whether fill should
> copy objects or not.  When you populate an array with immutable
> objects, creating multiple copies is a waste.
>
> On 4/28/06, Louis Cordier <lcordier at point45.com> wrote:
> >
> > Hi, I am not sure if this is the proper place to do a bug post.
> > I looked at the active tickets on http://projects.scipy.org/scipy/numpy/
> > but didn't feel confident to go and create a new one. ;)
> >
> > Anyway the current release version 0.9.6 have some broken behavior.
> > I guess some example code would illustrate it best.
> >
> > ---8<----------------
> >
> > >>> z = numpy.zeros((10,10), 'O')
> > >>> z.fill(None)
> > >>> z.fill([])
> > Segmentation fault (core dumped)
> >
> > This happens on both Linux and FreeBSD machines.
> > (both builds use *_lite versions of Lapack)
> >
> > Linux bellagio 2.6.11-1.1369_FC4 #1 Thu Jun 2 22:55:56 EDT 2005 i686 i686
> > i386 GNU/Linux
> > Python 2.4.1
> > gcc version 4.0.0 20050519 (Red Hat 4.0.0-8)
> >
> > FreeBSD cerberus.intranet 5.4-RELEASE-p12 FreeBSD 5.4-RELEASE-p12 #0: Wed
> > Mar 15 16:06:48 UTC 2006
> > Python 2.4.2
> > gcc version 3.4.2 [FreeBSD] 20040728
> >
> > I assume fill() will need to make a copy, of the object
> > for each coordinate in the matix.
> >
> > ---8<----------------
> >
> > While,
> >
> > >>> import numpy
> > >>> z = numpy.zeros((2,2), 'O')
> > >>> z
> > array([[0, 0],
> >         [0, 0]], dtype=object)
> > >>> z.fill([1])
> > >>> z
> > array([[1, 1],
> >         [1, 1]], dtype=object)
> >
> > and
> >
> > >>> z.fill([1,2,3])
> > >>> z
> > array([[1, 1],
> >         [1, 1]], dtype=object)
> >
> >
> > I would have expected,
> >
> > >>> z
> > array([[[1], [1]],
> >         [[1], [1]]], dtype=object)
> >
> > and
> >
> > >>> z
> > array([[[1, 2, 3], [1, 2, 3]],
> >         [[1, 2, 3], [1, 2, 3]]], dtype=object)
> >
> >
> > Regards, Louis.
> >
> > --
> > Louis Cordier <lcordier at point45.com> cell: +27721472305
> > Point45 Entertainment (Pty) Ltd. http://www.point45.org
> >
> >
> >
> > -------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services, security?
> > Get stuff done quickly with pre-integrated technology to make your job easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > _______________________________________________
> > Numpy-discussion mailing list
> > Numpy-discussion at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/numpy-discussion
> >
>




More information about the Numpy-discussion mailing list