Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-02 Thread josef . pktd
On Tue, Feb 2, 2010 at 8:53 AM, wrote: > 2010/2/2 Ernest Adrogué : >>  2/02/10 @ 00:01 (-0700), thus spake Charles R Harris: >>> On Mon, Feb 1, 2010 at 10:57 PM, wrote: >>> >>> > On Tue, Feb 2, 2010 at 12:31 AM, Charles R Harris >>> > wrote: >>> > > >>> > > >>> > > On Mon, Feb 1, 2010 at 10:02

Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-02 Thread josef . pktd
2010/2/2 Ernest Adrogué : >  2/02/10 @ 00:01 (-0700), thus spake Charles R Harris: >> On Mon, Feb 1, 2010 at 10:57 PM, wrote: >> >> > On Tue, Feb 2, 2010 at 12:31 AM, Charles R Harris >> > wrote: >> > > >> > > >> > > On Mon, Feb 1, 2010 at 10:02 PM, wrote: >> > >> >> > >> On Mon, Feb 1, 2010 at

Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-02 Thread Ernest Adrogué
2/02/10 @ 00:01 (-0700), thus spake Charles R Harris: > On Mon, Feb 1, 2010 at 10:57 PM, wrote: > > > On Tue, Feb 2, 2010 at 12:31 AM, Charles R Harris > > wrote: > > > > > > > > > On Mon, Feb 1, 2010 at 10:02 PM, wrote: > > >> > > >> On Mon, Feb 1, 2010 at 11:45 PM, Charles R Harris > > >> w

Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-01 Thread Charles R Harris
On Mon, Feb 1, 2010 at 10:57 PM, wrote: > On Tue, Feb 2, 2010 at 12:31 AM, Charles R Harris > wrote: > > > > > > On Mon, Feb 1, 2010 at 10:02 PM, wrote: > >> > >> On Mon, Feb 1, 2010 at 11:45 PM, Charles R Harris > >> wrote: > >> > > >> > > >> > On Mon, Feb 1, 2010 at 9:36 PM, David Cournapeau

Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-01 Thread josef . pktd
On Tue, Feb 2, 2010 at 12:57 AM, wrote: > On Tue, Feb 2, 2010 at 12:31 AM, Charles R Harris > wrote: >> >> >> On Mon, Feb 1, 2010 at 10:02 PM, wrote: >>> >>> On Mon, Feb 1, 2010 at 11:45 PM, Charles R Harris >>> wrote: >>> > >>> > >>> > On Mon, Feb 1, 2010 at 9:36 PM, David Cournapeau >>> > w

Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-01 Thread josef . pktd
On Tue, Feb 2, 2010 at 12:31 AM, Charles R Harris wrote: > > > On Mon, Feb 1, 2010 at 10:02 PM, wrote: >> >> On Mon, Feb 1, 2010 at 11:45 PM, Charles R Harris >> wrote: >> > >> > >> > On Mon, Feb 1, 2010 at 9:36 PM, David Cournapeau >> > wrote: >> >> >> >> On Tue, Feb 2, 2010 at 1:05 PM,   wrot

Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-01 Thread Charles R Harris
On Mon, Feb 1, 2010 at 10:02 PM, wrote: > On Mon, Feb 1, 2010 at 11:45 PM, Charles R Harris > wrote: > > > > > > On Mon, Feb 1, 2010 at 9:36 PM, David Cournapeau > wrote: > >> > >> On Tue, Feb 2, 2010 at 1:05 PM, wrote: > >> > >> > I think this could be considered as a correct answer, the cou

Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-01 Thread David Cournapeau
Charles R Harris wrote: > > In this case I would expect an empty input to be a programming error and > raising an error to be the right thing. Ok, I fixed the code in the trunk to raise a ValueError in that case. Changing to return an empty array would be easy, cheers, David

Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-01 Thread josef . pktd
On Mon, Feb 1, 2010 at 11:45 PM, Charles R Harris wrote: > > > On Mon, Feb 1, 2010 at 9:36 PM, David Cournapeau wrote: >> >> On Tue, Feb 2, 2010 at 1:05 PM,   wrote: >> >> > I think this could be considered as a correct answer, the count of any >> > integer is zero. >> >> Maybe, but this shape is

Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-01 Thread Charles R Harris
On Mon, Feb 1, 2010 at 9:36 PM, David Cournapeau wrote: > On Tue, Feb 2, 2010 at 1:05 PM, wrote: > > > I think this could be considered as a correct answer, the count of any > > integer is zero. > > Maybe, but this shape is random - it would be different in different > conditions, as the length

Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-01 Thread David Cournapeau
On Tue, Feb 2, 2010 at 1:05 PM, wrote: > I think this could be considered as a correct answer, the count of any > integer is zero. Maybe, but this shape is random - it would be different in different conditions, as the length of the returned array is just some random memory location. > > Retur

Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-01 Thread josef . pktd
On Mon, Feb 1, 2010 at 8:37 PM, David Cournapeau wrote: > josef.p...@gmail.com wrote: >> On Mon, Feb 1, 2010 at 12:09 PM, Keith Goodman wrote: >>> 2010/2/1 Ernest Adrogué : Hello, Consider the following code: for j in range(5):        f = np.bincount(x[y == j])

Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-01 Thread David Cournapeau
josef.p...@gmail.com wrote: > On Mon, Feb 1, 2010 at 12:09 PM, Keith Goodman wrote: >> 2010/2/1 Ernest Adrogué : >>> Hello, >>> >>> Consider the following code: >>> >>> for j in range(5): >>>f = np.bincount(x[y == j]) >>> >>> It fails with MemoryError whenever y == j is all False element-w

Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-01 Thread josef . pktd
On Mon, Feb 1, 2010 at 12:09 PM, Keith Goodman wrote: > 2010/2/1 Ernest Adrogué : >> Hello, >> >> Consider the following code: >> >> for j in range(5): >>        f = np.bincount(x[y == j]) >> >> It fails with MemoryError whenever y == j is all False element-wise. >> >> >> In [96]: np.bincount([])

Re: [Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-01 Thread Keith Goodman
2010/2/1 Ernest Adrogué : > Hello, > > Consider the following code: > > for j in range(5): >        f = np.bincount(x[y == j]) > > It fails with MemoryError whenever y == j is all False element-wise. > > > In [96]: np.bincount([]) > --

[Numpy-discussion] np.bincount raises MemoryError when given an empty array

2010-02-01 Thread Ernest Adrogué
Hello, Consider the following code: for j in range(5): f = np.bincount(x[y == j]) It fails with MemoryError whenever y == j is all False element-wise. In [96]: np.bincount([]) --- MemoryError