Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
Yeah Im aware of that, thats the reason why I suggested a warning level as an alternative. Setting no warnings as default would avoid breaking existing code. Gesendet:Sonntag, 08. Februar 2015 um 22:08 Uhr Von:Eelco Hoogendoorn hoogendoorn.ee...@gmail.com An:Discussion of Numerical Python

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread josef.pktd
On Sun, Feb 8, 2015 at 4:08 PM, Eelco Hoogendoorn hoogendoorn.ee...@gmail.com wrote: I personally use Octave and/or Numpy for several years now and never ever needed braodcasting. But since it is still there there will be many users who need it, there will be some use for it. Uhm, yeah,

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Charles R Harris
On Sun, Feb 8, 2015 at 2:14 PM, Stefan Reiterer dom...@gmx.net wrote: Yeah I'm aware of that, that's the reason why I suggested a warning level as an alternative. Setting no warnings as default would avoid breaking existing code. *Gesendet:* Sonntag, 08. Februar 2015 um 22:08 Uhr *Von:*

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
I dont think this is a good comparison, especially since broadcasting is a feature not a necessity... Its more like turning off/on driving assistance. And as already mentioned: other matrix languages also allow it, but they warn about its usage. This has indeed its merits.

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Matthew Brett
Hi, On Sun, Feb 8, 2015 at 1:24 PM, Stefan Reiterer dom...@gmx.net wrote: I don't think this is a good comparison, especially since broadcasting is a feature not a necessity ... It's more like turning off/on driving assistance. And as already mentioned: other matrix languages also allow it,

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Simon Wood
On Sun, Feb 8, 2015 at 4:24 PM, Stefan Reiterer dom...@gmx.net wrote: I don't think this is a good comparison, especially since broadcasting is a feature not a necessity ... It's more like turning off/on driving assistance. And as already mentioned: other matrix languages also allow it, but

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Warren Focke
On Sun, 8 Feb 2015, Stefan Reiterer wrote: And as already mentioned: other matrix languages also allow it, but they warn about it's usage. This has indeed it's merits. numpy isn't a matrix language. They're arrays. Storing numbers that you are thinking of as a vector in an array doesn't

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Matthew Brett
Hi, On Sun, Feb 8, 2015 at 1:39 PM, Simon Wood sgwoo...@gmail.com wrote: On Sun, Feb 8, 2015 at 4:24 PM, Stefan Reiterer dom...@gmx.net wrote: I don't think this is a good comparison, especially since broadcasting is a feature not a necessity ... It's more like turning off/on driving

[Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
Hi! As shortly discussed on github: https://github.com/numpy/numpy/issues/5541 I personally think that silent Broadcasting is not a good thing. I had recently a lot of trouble with row and column vectors which got bradcastet toghether altough it was more annoying than useful, especially

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Eelco Hoogendoorn
I personally use Octave and/or Numpy for several years now and never ever needed braodcasting. But since it is still there there will be many users who need it, there will be some use for it. Uhm, yeah, there is some use for it. Im all for explicit over implicit, but personally current

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
Actually I use numpy for several years now, and I love it. The reason that I think silent broadcasting of sums is bad comes simply from the fact, that I had moretrouble with it, than it helped me. I wont stop using numpy because of that, but I think this behavior may backfire, and thats the

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread josef.pktd
On Sun, Feb 8, 2015 at 4:56 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Sun, Feb 8, 2015 at 1:39 PM, Simon Wood sgwoo...@gmail.com wrote: On Sun, Feb 8, 2015 at 4:24 PM, Stefan Reiterer dom...@gmx.net wrote: I don't think this is a good comparison, especially since broadcasting

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread josef.pktd
On Sun, Feb 8, 2015 at 5:17 PM, Stefan Reiterer dom...@gmx.net wrote: Actually I use numpy for several years now, and I love it. The reason that I think silent broadcasting of sums is bad comes simply from the fact, that I had more trouble with it, than it helped me. I won't stop using numpy

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Nathaniel Smith
On 8 Feb 2015 13:39, Simon Wood sgwoo...@gmail.com wrote: I find the broadcasting aspect of Numpy a turn off. If I go to add a 1x3 vector to a 3x1 vector, I want the program to warn me or error out. I don't want it to do something under the covers that has no mathematical basis or definition.

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Simon Wood
On Sun, Feb 8, 2015 at 5:28 PM, josef.p...@gmail.com wrote: On Sun, Feb 8, 2015 at 4:56 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Sun, Feb 8, 2015 at 1:39 PM, Simon Wood sgwoo...@gmail.com wrote: On Sun, Feb 8, 2015 at 4:24 PM, Stefan Reiterer dom...@gmx.net wrote:

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Sturla Molden
Simon Wood sgwoo...@gmail.com wrote: Not quite the same. This is not so much about language semantics as mathematical definitions. You (the Numpy community) have decided to overload certain mathematical operators to act in a way that is not consistent with linear algebra teachings. We have

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Sturla Molden
On 08/02/15 23:17, Stefan Reiterer wrote: Actually I use numpy for several years now, and I love it. The reason that I think silent broadcasting of sums is bad comes simply from the fact, that I had more trouble with it, than it helped me. In Fortran 90, broadcasting allows us to write

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
Ok that are indeed some good reasons to keep the status quo, especially since performance is crucial for numpy. Its a dillemma: Using the matrix class for linear algebra would be the correct way for such thing, but the matrix API is not that powerful and beautiful as the one of arrays. On

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Eric Firing
On 2015/02/08 12:43 PM, josef.p...@gmail.com wrote: For me the main behavior I had to adjust to was loosing a dimension in any reduce operation, mean, sum, ... if x is 2d x - x.mean(1) we loose a dimension, and it doesn't broadcast in the right direction Though you can use: x_demeaned =