Re: [Numpy-discussion] reshaping empty array bug?

2016-02-23 Thread Benjamin Root
On Tue, Feb 23, 2016 at 3:30 PM, Nathaniel Smith wrote: > What should this do? > > np.zeros((12, 0)).reshape((10, -1, 2)) > It should error out, I already covered that. 12 != 20. Ben Root ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] reshaping empty array bug?

2016-02-23 Thread Nathaniel Smith
On Tue, Feb 23, 2016 at 12:23 PM, Benjamin Root wrote: > > On Tue, Feb 23, 2016 at 3:14 PM, Nathaniel Smith wrote: >> >> Sure, it's totally ambiguous. These are all legal: > > > > I would argue that except for the first reshape, all of those should be an >

Re: [Numpy-discussion] reshaping empty array bug?

2016-02-23 Thread Benjamin Root
On Tue, Feb 23, 2016 at 3:14 PM, Nathaniel Smith wrote: > Sure, it's totally ambiguous. These are all legal: I would argue that except for the first reshape, all of those should be an error, and that the current algorithm is buggy. This isn't a heuristic. It isn't guessing.

Re: [Numpy-discussion] reshaping empty array bug?

2016-02-23 Thread Nathaniel Smith
On Tue, Feb 23, 2016 at 8:45 AM, Benjamin Root wrote: > but, it isn't really ambiguous, is it? The -1 can only refer to a single > dimension, and if you ignore the zeros in the original and new shape, the -1 > is easily solvable, right? Sure, it's totally ambiguous. These

Re: [Numpy-discussion] reshaping empty array bug?

2016-02-23 Thread Sebastian Berg
On Di, 2016-02-23 at 21:06 +0100, Sebastian Berg wrote: > On Di, 2016-02-23 at 14:57 -0500, Benjamin Root wrote: > > I'd be more than happy to write up the patch. I don't think it > > would > > be quite like make zeros be ones, but it would be along those > > lines. > > One case I need to wrap my

Re: [Numpy-discussion] reshaping empty array bug?

2016-02-23 Thread Sebastian Berg
On Di, 2016-02-23 at 14:57 -0500, Benjamin Root wrote: > I'd be more than happy to write up the patch. I don't think it would > be quite like make zeros be ones, but it would be along those lines. > One case I need to wrap my head around is to make sure that a 0 would > happen if the following was

Re: [Numpy-discussion] reshaping empty array bug?

2016-02-23 Thread Benjamin Root
I'd be more than happy to write up the patch. I don't think it would be quite like make zeros be ones, but it would be along those lines. One case I need to wrap my head around is to make sure that a 0 would happen if the following was true: >>> a = np.ones((0, 5*64)) >>> a.shape = (-1, 5, 64)

Re: [Numpy-discussion] reshaping empty array bug?

2016-02-23 Thread Sebastian Berg
On Di, 2016-02-23 at 11:45 -0500, Benjamin Root wrote: > but, it isn't really ambiguous, is it? The -1 can only refer to a > single dimension, and if you ignore the zeros in the original and new > shape, the -1 is easily solvable, right? I think if there is a simple logic (like using 1 for all

Re: [Numpy-discussion] reshaping empty array bug?

2016-02-23 Thread Benjamin Root
but, it isn't really ambiguous, is it? The -1 can only refer to a single dimension, and if you ignore the zeros in the original and new shape, the -1 is easily solvable, right? Ben Root On Tue, Feb 23, 2016 at 11:41 AM, Warren Weckesser < warren.weckes...@gmail.com> wrote: > > > On Tue, Feb 23,

Re: [Numpy-discussion] reshaping empty array bug?

2016-02-23 Thread Warren Weckesser
On Tue, Feb 23, 2016 at 11:32 AM, Benjamin Root wrote: > Not exactly sure if this should be a bug or not. This came up in a fairly > general function of mine to process satellite data. Unexpectedly, one of > the satellite files had no scans in it, triggering an exception

[Numpy-discussion] reshaping empty array bug?

2016-02-23 Thread Benjamin Root
Not exactly sure if this should be a bug or not. This came up in a fairly general function of mine to process satellite data. Unexpectedly, one of the satellite files had no scans in it, triggering an exception when I tried to reshape the data from it. >>> import numpy as np >>> a = np.zeros((0,

Re: [Numpy-discussion] Is this a bug?

2014-09-17 Thread Sebastian Berg
On Di, 2014-09-16 at 16:51 -0400, Nathaniel Smith wrote: On Tue, Sep 16, 2014 at 4:31 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: If it is a bug, it is an extended one, because it is the same behavior of einsum: np.einsum('i,i', [1,1,1], [1]) 3 np.einsum('i,i', [1,1,1],

Re: [Numpy-discussion] Is this a bug?

2014-09-17 Thread Sebastian Berg
On Mi, 2014-09-17 at 06:33 -0600, Charles R Harris wrote: snip It would also be nice if the order could be made part of the signature as DGEMM and friends like one of the argument axis to be contiguous, but I don't see a clean way to do that. The gufuncs do have an order parameter

Re: [Numpy-discussion] Is this a bug?

2014-09-17 Thread Charles R Harris
On Wed, Sep 17, 2014 at 6:48 AM, Sebastian Berg sebast...@sipsolutions.net wrote: On Mi, 2014-09-17 at 06:33 -0600, Charles R Harris wrote: snip It would also be nice if the order could be made part of the signature as DGEMM and friends like one of the argument axis to be

Re: [Numpy-discussion] Is this a bug?

2014-09-17 Thread Charles R Harris
On Wed, Sep 17, 2014 at 6:57 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Sep 17, 2014 at 6:48 AM, Sebastian Berg sebast...@sipsolutions.net wrote: On Mi, 2014-09-17 at 06:33 -0600, Charles R Harris wrote: snip It would also be nice if the order could be made

Re: [Numpy-discussion] Is this a bug?

2014-09-17 Thread Jaime Fernández del Río
On Wed, Sep 17, 2014 at 1:27 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Sep 17, 2014 at 6:57 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Sep 17, 2014 at 6:48 AM, Sebastian Berg sebast...@sipsolutions.net wrote: On Mi, 2014-09-17 at 06:33 -0600,

Re: [Numpy-discussion] Is this a bug?

2014-09-17 Thread Charles R Harris
On Wed, Sep 17, 2014 at 3:01 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Wed, Sep 17, 2014 at 1:27 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Sep 17, 2014 at 6:57 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Sep 17, 2014 at 6:48 AM,

Re: [Numpy-discussion] Is this a bug?

2014-09-17 Thread Charles R Harris
On Wed, Sep 17, 2014 at 3:29 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Sep 17, 2014 at 3:01 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Wed, Sep 17, 2014 at 1:27 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Sep 17, 2014 at 6:57 AM,

[Numpy-discussion] Is this a bug?

2014-09-16 Thread Charles R Harris
Hi All, It turns out that gufuncs will broadcast the last dimension if it is one. For instance, inner1d has signature `(n), (n) - ()`, yet In [27]: inner1d([1,1,1], [1]) Out[27]: 3 In [28]: inner1d([1,1,1], [1,1]) ---

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Charles R Harris
On Tue, Sep 16, 2014 at 1:27 PM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, It turns out that gufuncs will broadcast the last dimension if it is one. For instance, inner1d has signature `(n), (n) - ()`, yet In [27]: inner1d([1,1,1], [1]) Out[27]: 3 In [28]:

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Nathaniel Smith
On Tue, Sep 16, 2014 at 3:27 PM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, It turns out that gufuncs will broadcast the last dimension if it is one. For instance, inner1d has signature `(n), (n) - ()`, yet In [27]: inner1d([1,1,1], [1]) Out[27]: 3 Yes, this looks totally

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread josef.pktd
On Tue, Sep 16, 2014 at 3:42 PM, Nathaniel Smith n...@pobox.com wrote: On Tue, Sep 16, 2014 at 3:27 PM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, It turns out that gufuncs will broadcast the last dimension if it is one. For instance, inner1d has signature `(n), (n) - ()`, yet

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Charles R Harris
On Tue, Sep 16, 2014 at 1:55 PM, josef.p...@gmail.com wrote: On Tue, Sep 16, 2014 at 3:42 PM, Nathaniel Smith n...@pobox.com wrote: On Tue, Sep 16, 2014 at 3:27 PM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, It turns out that gufuncs will broadcast the last dimension if

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Nathaniel Smith
On Tue, Sep 16, 2014 at 3:55 PM, josef.p...@gmail.com wrote: On Tue, Sep 16, 2014 at 3:42 PM, Nathaniel Smith n...@pobox.com wrote: On Tue, Sep 16, 2014 at 3:27 PM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, It turns out that gufuncs will broadcast the last dimension if it is

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Jaime Fernández del Río
On Tue, Sep 16, 2014 at 12:27 PM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, It turns out that gufuncs will broadcast the last dimension if it is one. For instance, inner1d has signature `(n), (n) - ()`, yet In [27]: inner1d([1,1,1], [1]) Out[27]: 3 In [28]:

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Nathaniel Smith
On Tue, Sep 16, 2014 at 4:31 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: If it is a bug, it is an extended one, because it is the same behavior of einsum: np.einsum('i,i', [1,1,1], [1]) 3 np.einsum('i,i', [1,1,1], [1,1]) Traceback (most recent call last): File stdin, line 1,

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Charles R Harris
On Tue, Sep 16, 2014 at 2:51 PM, Nathaniel Smith n...@pobox.com wrote: On Tue, Sep 16, 2014 at 4:31 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: If it is a bug, it is an extended one, because it is the same behavior of einsum: np.einsum('i,i', [1,1,1], [1]) 3

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Jaime Fernández del Río
On Tue, Sep 16, 2014 at 3:26 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Sep 16, 2014 at 2:51 PM, Nathaniel Smith n...@pobox.com wrote: On Tue, Sep 16, 2014 at 4:31 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: If it is a bug, it is an extended one, because it

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Eric Moore
On Tuesday, September 16, 2014, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Tue, Sep 16, 2014 at 3:26 PM, Charles R Harris charlesr.har...@gmail.com javascript:_e(%7B%7D,'cvml','charlesr.har...@gmail.com'); wrote: On Tue, Sep 16, 2014 at 2:51 PM, Nathaniel Smith n...@pobox.com

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Charles R Harris
On Tue, Sep 16, 2014 at 4:56 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Tue, Sep 16, 2014 at 3:26 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Sep 16, 2014 at 2:51 PM, Nathaniel Smith n...@pobox.com wrote: On Tue, Sep 16, 2014 at 4:31 PM, Jaime Fernández

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Charles R Harris
On Tue, Sep 16, 2014 at 5:03 PM, Eric Moore e...@redtetrahedron.org wrote: On Tuesday, September 16, 2014, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Tue, Sep 16, 2014 at 3:26 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Sep 16, 2014 at 2:51 PM, Nathaniel

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Nathaniel Smith
On Tue, Sep 16, 2014 at 6:56 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Tue, Sep 16, 2014 at 3:26 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Sep 16, 2014 at 2:51 PM, Nathaniel Smith n...@pobox.com wrote: On Tue, Sep 16, 2014 at 4:31 PM, Jaime Fernández del

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Jaime Fernández del Río
On Tue, Sep 16, 2014 at 4:32 PM, Nathaniel Smith n...@pobox.com wrote: On Tue, Sep 16, 2014 at 6:56 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Tue, Sep 16, 2014 at 3:26 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Sep 16, 2014 at 2:51 PM, Nathaniel Smith

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Nathaniel Smith
On Tue, Sep 16, 2014 at 8:31 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Tue, Sep 16, 2014 at 4:32 PM, Nathaniel Smith n...@pobox.com wrote: On Tue, Sep 16, 2014 at 6:56 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: Are we OK with the appending of size 1 dimensions

Re: [Numpy-discussion] Is this a bug?

2014-09-16 Thread Jaime Fernández del Río
On Tue, Sep 16, 2014 at 4:32 PM, Nathaniel Smith n...@pobox.com wrote: On Tue, Sep 16, 2014 at 6:56 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Tue, Sep 16, 2014 at 3:26 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Sep 16, 2014 at 2:51 PM, Nathaniel Smith

Re: [Numpy-discussion] np.dot and 'out' bug

2013-05-23 Thread Matthieu Brucher
Hi, It's to be expected. You are overwritten one of your input vector while it is still being used. So not a numpy bug ;) Matthieu 2013/5/23 Pierre Haessig pierre.haes...@crans.org Hi Nicolas, Le 23/05/2013 15:45, Nicolas Rougier a écrit : if I use either a or b as output, results are

Re: [Numpy-discussion] np.dot and 'out' bug

2013-05-23 Thread Nathaniel Smith
On Thu, May 23, 2013 at 3:19 PM, Matthieu Brucher matthieu.bruc...@gmail.com wrote: Hi, It's to be expected. You are overwritten one of your input vector while it is still being used. So not a numpy bug ;) Sure, that's clearly what's going on, but numpy shouldn't let you silently shoot

Re: [Numpy-discussion] np.dot and 'out' bug

2013-05-23 Thread Nicolas Rougier
Sure, that's clearly what's going on, but numpy shouldn't let you silently shoot yourself in the foot like that. Re-using input as output is a very common operation, and usually supported fine. Probably we should silently make a copy of any input(s) that overlap with the output? For

Re: [Numpy-discussion] np.dot and 'out' bug

2013-05-23 Thread Matthieu Brucher
In my point of view, you should never use an output argument equal to an input argument. It can impede a lot of optimizations. Matthieu 2013/5/23 Nicolas Rougier nicolas.roug...@inria.fr Sure, that's clearly what's going on, but numpy shouldn't let you silently shoot yourself in the

Re: [Numpy-discussion] np.dot and 'out' bug

2013-05-23 Thread Nathaniel Smith
On Thu, May 23, 2013 at 3:57 PM, Matthieu Brucher matthieu.bruc...@gmail.com wrote: In my point of view, you should never use an output argument equal to an input argument. It can impede a lot of optimizations. This is a fine philosophy in some cases, but a non-starter in others. Python doesn't

Re: [Numpy-discussion] np.dot and 'out' bug

2013-05-23 Thread Nicolas Rougier
Can you file a bug in the bug tracker so this won't get lost? Done. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Second try: possible bug in assignment to complex array

2012-08-11 Thread Mark Bakker
Shall I file a bug report? Or is this fairly easy to fix? Mark On Fri, Aug 10, 2012 at 11:41 AM, josef.p...@gmail.com wrote: On Fri, Aug 10, 2012 at 10:00 AM, Travis Oliphant tra...@continuum.io wrote: On Aug 10, 2012, at 5:37 AM, Paul Anton Letnes wrote: On 10. aug.

[Numpy-discussion] Second try: possible bug in assignment to complex array

2012-08-10 Thread Mark Bakker
? Thanks, Mark ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Second try: possible bug in assignment to complex array

2012-08-10 Thread Dave Hirschfeld
Mark Bakker markbak at gmail.com writes: I think there is a problem with assigning a 1D complex array of length one to a position in another complex array. Example: a = ones(1,'D') b = ones(1,'D') a[0] = b ---

Re: [Numpy-discussion] Second try: possible bug in assignment to complex array

2012-08-10 Thread Fabrice Silva
Le vendredi 10 août 2012, Dave Hirschfeld a écrit : Mark Bakker markbak at gmail.com writes: I think there is a problem with assigning a 1D complex array of length one to a position in another complex array. Example: a = ones(1,'D') b = ones(1,'D') a[0] = b

Re: [Numpy-discussion] Second try: possible bug in assignment to complex array

2012-08-10 Thread Paul Anton Letnes
On 10. aug. 2012, at 09:54, Mark Bakker wrote: I am giving this a second try. Can anybody help me out? I think there is a problem with assigning a 1D complex array of length one to a position in another complex array. Example: a = ones(1,'D') b = ones(1,'D') a[0] = b

Re: [Numpy-discussion] Second try: possible bug in assignment to complex array

2012-08-10 Thread Travis Oliphant
On Aug 10, 2012, at 5:37 AM, Paul Anton Letnes wrote: On 10. aug. 2012, at 09:54, Mark Bakker wrote: I am giving this a second try. Can anybody help me out? I think there is a problem with assigning a 1D complex array of length one to a position in another complex array. Example:

Re: [Numpy-discussion] Second try: possible bug in assignment to complex array

2012-08-10 Thread josef . pktd
On Fri, Aug 10, 2012 at 10:00 AM, Travis Oliphant tra...@continuum.iowrote: On Aug 10, 2012, at 5:37 AM, Paul Anton Letnes wrote: On 10. aug. 2012, at 09:54, Mark Bakker wrote: I am giving this a second try. Can anybody help me out? I think there is a problem with assigning a 1D

Re: [Numpy-discussion] Second try: possible bug in assignment to complex array

2012-08-10 Thread josef . pktd
On Fri, Aug 10, 2012 at 11:41 AM, josef.p...@gmail.com wrote: On Fri, Aug 10, 2012 at 10:00 AM, Travis Oliphant tra...@continuum.iowrote: On Aug 10, 2012, at 5:37 AM, Paul Anton Letnes wrote: On 10. aug. 2012, at 09:54, Mark Bakker wrote: I am giving this a second try. Can

[Numpy-discussion] Strange numpy behaviour (bug?)

2012-01-17 Thread Sturla Molden
While playing with a point-in-polygon test, I have discovered some a failure mode that I cannot make sence of. The algorithm is vectorized for NumPy from a C and Python implementation I found on the net (see links below). It is written to process a large dataset in chunks. I'm rather happy

Re: [Numpy-discussion] Strange numpy behaviour (bug?)

2012-01-17 Thread Sturla Molden
Never mind this, it was my own mistake as I expected :-) def __chunk(n,size): x = range(0,n,size) x.append(n) return zip(x[:-1],x[1:]) makes it a lot better :) Sturla Den 18.01.2012 06:26, skrev Sturla Molden: While playing with a point-in-polygon test, I have discovered

[Numpy-discussion] numpy log2 has bug

2011-03-23 Thread Dmitrey
from numpy import log2, __version__ log2(2**63) Traceback (most recent call last):

Re: [Numpy-discussion] numpy log2 has bug

2011-03-23 Thread josef . pktd
2011/3/23 Dmitrey tm...@ukr.net: from numpy import log2, __version__ log2(2**63) Traceback (most recent call last):   File stdin, line 1, in module AttributeError: log2 __version__ '2.0.0.dev-1fe8136' (doesn't work with 1.3.0 as well) np.array([2**63]) array([9223372036854775808],

Re: [Numpy-discussion] numpy log2 has bug

2011-03-23 Thread Robert Kern
On Wed, Mar 23, 2011 at 13:51, josef.p...@gmail.com wrote: 2011/3/23 Dmitrey tm...@ukr.net: from numpy import log2, __version__ log2(2**63) Traceback (most recent call last):   File stdin, line 1, in module AttributeError: log2 __version__ '2.0.0.dev-1fe8136' (doesn't work with 1.3.0

Re: [Numpy-discussion] Is this a bug in repr ?

2011-03-16 Thread Mark Sienkiewicz
In that case, would you agree that it is a bug for assert_array_almost_equal to use repr() to display the arrays, since it is printing identical values and saying they are different? Or is there also a reason to do that? It should probably use np.array_repr(x, precision=16) Ok,

[Numpy-discussion] Is this a bug in repr ?

2011-03-15 Thread Mark Sienkiewicz
The usual expectation is that (when possible) repr() returns a value that you can eval() to get the original data back. But, from numpy import * a = array( [ 16.5069863163822 ] ) b = eval(repr(a)) a-b array([ -3.6111e-09]) import numpy.testing

Re: [Numpy-discussion] Is this a bug in repr ?

2011-03-15 Thread Charles R Harris
On Tue, Mar 15, 2011 at 10:20 AM, Mark Sienkiewicz sienk...@stsci.eduwrote: The usual expectation is that (when possible) repr() returns a value that you can eval() to get the original data back. But, from numpy import * a = array( [ 16.5069863163822 ] ) b = eval(repr(a)) a-b

Re: [Numpy-discussion] Is this a bug in repr ?

2011-03-15 Thread Robert Kern
On Tue, Mar 15, 2011 at 12:39, Charles R Harris charlesr.har...@gmail.com wrote: Yes, I think it is a bug. IIRC, it also shows up for object arrays. It's extremely long-standing, documented, intentional behavior dating back to Numeric. [~] |1 import Numeric [~] |2 a = Numeric.array( [

Re: [Numpy-discussion] Is this a bug in repr ?

2011-03-15 Thread Mark Sienkiewicz
Robert Kern wrote: On Tue, Mar 15, 2011 at 12:39, Charles R Harris charlesr.har...@gmail.com wrote: Yes, I think it is a bug. IIRC, it also shows up for object arrays. It's extremely long-standing, documented, intentional behavior dating back to Numeric. [~] |1 import Numeric

Re: [Numpy-discussion] Is this a bug in repr ?

2011-03-15 Thread Robert Kern
On Tue, Mar 15, 2011 at 13:10, Mark Sienkiewicz sienk...@stsci.edu wrote: Robert Kern wrote: On Tue, Mar 15, 2011 at 12:39, Charles R Harris charlesr.har...@gmail.com wrote: Yes, I think it is a bug. IIRC, it also shows up for object arrays. It's extremely long-standing, documented,

[Numpy-discussion] DataArray usage question + bug?

2010-08-23 Thread Skipper Seabold
I have some new typical data that I'm trying out DataArray with, and I'm trying to get my head around it again. Is this the best way to hold data organized by, say, household and time (week number). I guess what I'm asking is do I understand the concept of axes and ticks correctly? It seems to

Re: [Numpy-discussion] DataArray usage question + bug?

2010-08-23 Thread Keith Goodman
On Mon, Aug 23, 2010 at 3:28 PM, Skipper Seabold jsseab...@gmail.com wrote: hhold_ax = 'households', np.unique(ddd[:,0]).tolist() snip As for the bug report.  If I don't tolist() the ticks above there is an error.  I can file a bug report if it's warranted. If you add it to the tracker

Re: [Numpy-discussion] ma.std(ddof=1) bug?

2010-04-28 Thread Pierre GM
On Apr 23, 2010, at 12:45 PM, josef.p...@gmail.com wrote: Is there a reason why ma.std(ddof=1) does not calculated the std if there are 2 valid values? Bug! Good call... Should be fixed in SVN r8370. ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] Is this a bug, and if so, who's?

2010-04-25 Thread Travis Oliphant
On Apr 21, 2010, at 10:47 AM, Ken Basye wrote: Folks, Apologies for asking here, but I ran across this problem yesterday and probably need to file a bug. The problem is I don't know if this is a Numpy bug, a Python bug, or both. Here's an illustration, platform information follows.

[Numpy-discussion] ma.std(ddof=1) bug?

2010-04-25 Thread josef . pktd
Is there a reason why ma.std(ddof=1) does not calculated the std if there are 2 valid values? example nan = np.nan x1 = np.array([[9.0, 3.0, nan, nan, 9.0, nan], [1.0, 1.0, 1.0, nan, nan, nan], [2.0, 2.0, 0.01, nan, 1.0, nan], [3.0, 9.0, 2.0, nan, nan,

[Numpy-discussion] Is this a bug, and if so, who's?

2010-04-21 Thread Ken Basye
Folks, Apologies for asking here, but I ran across this problem yesterday and probably need to file a bug. The problem is I don't know if this is a Numpy bug, a Python bug, or both. Here's an illustration, platform information follows. TIA, Ken

Re: [Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-08 Thread Bruce Southey
On 03/08/2010 01:30 AM, David Goldsmith wrote: On Sun, Mar 7, 2010 at 4:41 AM, Friedrich Romstedt friedrichromst...@gmail.com mailto:friedrichromst...@gmail.com wrote: 2010/3/5 Pierre GM pgmdevl...@gmail.com mailto:pgmdevl...@gmail.com: 'm'fraid no. I gonna have to investigate

Re: [Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-08 Thread David Goldsmith
On Mon, Mar 8, 2010 at 6:52 AM, Bruce Southey bsout...@gmail.com wrote: On 03/08/2010 01:30 AM, David Goldsmith wrote: On Sun, Mar 7, 2010 at 4:41 AM, Friedrich Romstedt friedrichromst...@gmail.com wrote: I would like to stress the fact that imo this is maybe not ticket and not a bug.

Re: [Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-08 Thread David Goldsmith
On Mon, Mar 8, 2010 at 10:17 AM, David Goldsmith d.l.goldsm...@gmail.comwrote: On Mon, Mar 8, 2010 at 6:52 AM, Bruce Southey bsout...@gmail.com wrote: On 03/08/2010 01:30 AM, David Goldsmith wrote: On Sun, Mar 7, 2010 at 4:41 AM, Friedrich Romstedt friedrichromst...@gmail.com wrote: I

Re: [Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-08 Thread Friedrich Romstedt
It's pretty simple, but I was stunned myself how simple. Have a look at line 65 of your script you provided: W = W.T This means, x - y. But in the for loops, you still act as if W wasn't transposed. I added some prints, the positions should be clear for you: argW.shape = (320, 200) i, j =

Re: [Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-08 Thread Bruce Southey
On 03/08/2010 12:17 PM, David Goldsmith wrote: On Mon, Mar 8, 2010 at 6:52 AM, Bruce Southey bsout...@gmail.com mailto:bsout...@gmail.com wrote: On 03/08/2010 01:30 AM, David Goldsmith wrote: On Sun, Mar 7, 2010 at 4:41 AM, Friedrich Romstedt friedrichromst...@gmail.com

Re: [Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-08 Thread Friedrich Romstedt
2010/3/8 Bruce Southey bsout...@gmail.com: Hmm, Appears that you have mixed your indices when creating part2plot. If you this line instead it works: part2plot = argW[j*nx/4:(j+1)*nx/4, i*ny/4:(i+1)*ny/4] I found that by looking the shape of the part2plot array that is component of the argW

Re: [Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-08 Thread David Goldsmith
How embarrassing! :O Well, as they say, 'nother set of eyes... Thanks! DG On Mon, Mar 8, 2010 at 11:25 AM, Friedrich Romstedt friedrichromst...@gmail.com wrote: It's pretty simple, but I was stunned myself how simple. Have a look at line 65 of your script you provided: W = W.T This

Re: [Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-07 Thread Friedrich Romstedt
2010/3/5 Pierre GM pgmdevl...@gmail.com: 'm'fraid no. I gonna have to investigate that. Please open a ticket with a self-contained example that reproduces the issue. Thx in advance... P. I would like to stress the fact that imo this is maybe not ticket and not a bug. The issue arises when

Re: [Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-07 Thread David Goldsmith
On Sun, Mar 7, 2010 at 4:41 AM, Friedrich Romstedt friedrichromst...@gmail.com wrote: 2010/3/5 Pierre GM pgmdevl...@gmail.com: 'm'fraid no. I gonna have to investigate that. Please open a ticket with a self-contained example that reproduces the issue. Thx in advance... P. I would like

[Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-05 Thread David Goldsmith
Hi! Sorry for the cross-post, but my own investigation has led me to suspect that mine is actually a numpy problem, not a matplotlib problem. I'm getting the following traceback from a call to matplotlib.imshow: Traceback (most recent call last): File

Re: [Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-05 Thread Pierre GM
On Mar 5, 2010, at 4:38 AM, David Goldsmith wrote: Hi! Sorry for the cross-post, but my own investigation has led me to suspect that mine is actually a numpy problem, not a matplotlib problem. I'm getting the following traceback from a call to matplotlib.imshow: ... Based on examination

Re: [Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-05 Thread Vincent Schut
On 03/05/2010 11:51 AM, Pierre GM wrote: On Mar 5, 2010, at 4:38 AM, David Goldsmith wrote: Hi! Sorry for the cross-post, but my own investigation has led me to suspect that mine is actually a numpy problem, not a matplotlib problem. I'm getting the following traceback from a call to

Re: [Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-05 Thread David Goldsmith
On Fri, Mar 5, 2010 at 2:51 AM, Pierre GM pgmdevl...@gmail.com wrote: On Mar 5, 2010, at 4:38 AM, David Goldsmith wrote: Hi! Sorry for the cross-post, but my own investigation has led me to suspect that mine is actually a numpy problem, not a matplotlib problem. I'm getting the following

Re: [Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-05 Thread David Goldsmith
On Fri, Mar 5, 2010 at 9:22 AM, David Goldsmith d.l.goldsm...@gmail.comwrote: On Fri, Mar 5, 2010 at 2:51 AM, Pierre GM pgmdevl...@gmail.com wrote: On Mar 5, 2010, at 4:38 AM, David Goldsmith wrote: Hi! Sorry for the cross-post, but my own investigation has led me to suspect that mine is

Re: [Numpy-discussion] Is this a bug in numpy.ma.reduce?

2010-03-05 Thread David Goldsmith
On Fri, Mar 5, 2010 at 9:43 AM, David Goldsmith d.l.goldsm...@gmail.comwrote: On Fri, Mar 5, 2010 at 9:22 AM, David Goldsmith d.l.goldsm...@gmail.comwrote: On Fri, Mar 5, 2010 at 2:51 AM, Pierre GM pgmdevl...@gmail.com wrote: On Mar 5, 2010, at 4:38 AM, David Goldsmith wrote: Hi! Sorry

Re: [Numpy-discussion] Numpy 1.4 MaskedArray bug?

2010-01-19 Thread Charles سمير Doutriaux
Hi Pierre, We didn't move to 1.4 yet. Should we wait for 1.4.1? It seems there's some issues with numpy.ma in 1.4 and we rely heavily on it. C. On Jan 12, 2010, at 11:50 AM, Pierre GM wrote: On Jan 12, 2010, at 1:52 PM, Charles R Harris wrote: On Tue, Jan 12, 2010 at 11:32 AM, Pauli

[Numpy-discussion] Numpy 1.4 MaskedArray bug?

2010-01-12 Thread stephen.pascoe
We have noticed the MaskedArray implementation in numpy-1.4.0 breaks some of our code. For instance we see the following: in 1.3.0: a = numpy.ma.MaskedArray([[1,2,3],[4,5,6]]) numpy.ma.sum(a, 1) masked_array(data = [ 6 15], mask = False, fill_value = 99) in 1.4.0 a =

Re: [Numpy-discussion] Numpy 1.4 MaskedArray bug?

2010-01-12 Thread Pierre GM
On Jan 12, 2010, at 10:52 AM, stephen.pas...@stfc.ac.uk stephen.pas...@stfc.ac.uk wrote: We have noticed the MaskedArray implementation in numpy-1.4.0 breaks some of our code. For instance we see the following: My, that's embarrassing. Sorry for the inconvenience. in 1.3.0: a =

Re: [Numpy-discussion] Numpy 1.4 MaskedArray bug?

2010-01-12 Thread Pauli Virtanen
ti, 2010-01-12 kello 12:51 -0500, Pierre GM kirjoitti: [clip] a = numpy.ma.MaskedArray([[1,2,3],[4,5,6]]) numpy.ma.sum(a, 1) Traceback (most recent call last): File stdin, line 1, in module File /usr/lib64/python2.5/site-packages/numpy-1.4.0-py2.5-linux-x86_64.egg/n

Re: [Numpy-discussion] Numpy 1.4 MaskedArray bug?

2010-01-12 Thread Charles R Harris
On Tue, Jan 12, 2010 at 11:32 AM, Pauli Virtanen p...@iki.fi wrote: ti, 2010-01-12 kello 12:51 -0500, Pierre GM kirjoitti: [clip] a = numpy.ma.MaskedArray([[1,2,3],[4,5,6]]) numpy.ma.sum(a, 1) Traceback (most recent call last): File stdin, line 1, in module File

Re: [Numpy-discussion] Numpy 1.4 MaskedArray bug?

2010-01-12 Thread Pierre GM
On Jan 12, 2010, at 1:52 PM, Charles R Harris wrote: On Tue, Jan 12, 2010 at 11:32 AM, Pauli Virtanen p...@iki.fi wrote: ti, 2010-01-12 kello 12:51 -0500, Pierre GM kirjoitti: [clip] a = numpy.ma.MaskedArray([[1,2,3],[4,5,6]]) numpy.ma.sum(a, 1) Traceback (most recent call last):

[Numpy-discussion] Numpy large array bug

2009-09-21 Thread Kashyap Ashwin
. Thanks, Ashwin ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Numpy large array bug

2009-09-21 Thread Francesc Alted
) and a 64-bit platform. I suppose that you should file a bug better. -- Francesc Alted ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Numpy large array bug

2009-09-21 Thread Charles R Harris
___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Numpy large array bug

2009-09-21 Thread Kashyap Ashwin
. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Numpy large array bug

2009-09-21 Thread Citi, Luca
I can confirm this bug for the last svn. Also: a.put([2*1024*1024*1024 + 100,], 8) IndexError: index out of range for array in this case, I think the error is that in numpy/core/src/multiarray/item_selection.c in PyArray_PutTo line 209 should be: intp i, chunk, ni, max_item, nv, tmp;

[Numpy-discussion] Numpy large array bug

2009-09-21 Thread Kashyap Ashwin
Also, what about PyArray_PutMask() That function also has a line like int i, chunk, ni, max_item, nv, tmp; Should that be changed as well? (Your patch does not fix my original issue.) BTW, in numpy 1.3, that is present in numpy/core/src/multiarraymodule.c. Can someone please give me a

Re: [Numpy-discussion] Numpy large array bug

2009-09-21 Thread Citi, Luca
I think the original bug is due to line 535 of numpy/core/src/multiarray/ctors.c (svn) that should be: intp numcopies, nbytes; instead of: int numcopies, nbytes; To resume: in line 535 of numpy/core/src/multiarray/ctors.c and in line 209 of numpy/core/src/multiarray/item_selection.c int

Re: [Numpy-discussion] Numpy large array bug

2009-09-21 Thread Charles R Harris
Hi, Luca, On Mon, Sep 21, 2009 at 4:52 PM, Citi, Luca lc...@essex.ac.uk wrote: I think the original bug is due to line 535 of numpy/core/src/multiarray/ctors.c (svn) that should be: intp numcopies, nbytes; instead of: int numcopies, nbytes; To resume: in line 535 of

Re: [Numpy-discussion] Numpy large array bug

2009-09-21 Thread Citi, Luca
Here it is... http://projects.scipy.org/numpy/ticket/1229 ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Is this a bug in numpy.distutils ?

2009-08-04 Thread Dave
David Cournapeau david at ar.media.kyoto-u.ac.jp writes: Matthew Brett wrote: Hi, We are using numpy.distutils, and have run into this odd behavior in windows: Short answer: I am afraid it cannot work as you want. Basically, when you pass an option to build_ext, it does not

Re: [Numpy-discussion] Is this a bug in numpy.distutils ?

2009-08-04 Thread David Cournapeau
Dave wrote: David Cournapeau david at ar.media.kyoto-u.ac.jp writes: Matthew Brett wrote: Hi, We are using numpy.distutils, and have run into this odd behavior in windows: Short answer: I am afraid it cannot work as you want. Basically, when you pass an option to

Re: [Numpy-discussion] Is this a bug in numpy.distutils ?

2009-08-04 Thread Dave
David Cournapeau david at ar.media.kyoto-u.ac.jp writes: You need to do as follows, if you want to control from the command line: python setup.py build -c mingw32 bdist_wininst That's how I build the official binaries . cheers, David Running the command: C:\dev\src\numpypython

Re: [Numpy-discussion] Is this a bug in numpy.distutils ?

2009-08-04 Thread David Cournapeau
Dave wrote: David Cournapeau david at ar.media.kyoto-u.ac.jp writes: You need to do as follows, if you want to control from the command line: python setup.py build -c mingw32 bdist_wininst That's how I build the official binaries . cheers, David Running the command:

  1   2   >