<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 8, 2015 at 5:28 PM, <span dir="ltr"><<a href="mailto:josef.pktd@gmail.com" target="_blank">josef.pktd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Sun, Feb 8, 2015 at 4:56 PM, Matthew Brett <<a href="mailto:matthew.brett@gmail.com">matthew.brett@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> On Sun, Feb 8, 2015 at 1:39 PM, Simon Wood <<a href="mailto:sgwoodjr@gmail.com">sgwoodjr@gmail.com</a>> wrote:<br>
>><br>
>><br>
>> On Sun, Feb 8, 2015 at 4:24 PM, Stefan Reiterer <<a href="mailto:domors@gmx.net">domors@gmx.net</a>> wrote:<br>
>>><br>
>>> I don't think this is a good comparison, especially since broadcasting is<br>
>>> a feature not a necessity ...<br>
>>> It's more like turning off/on driving assistance.<br>
>>><br>
>>> And as already mentioned: other matrix languages also allow it, but they<br>
>>> warn about it's usage.<br>
>>> This has indeed it's merits.<br>
>>> Gesendet: Sonntag, 08. Februar 2015 um 22:17 Uhr<br>
>>> Von: "Charles R Harris" <<a href="mailto:charlesr.harris@gmail.com">charlesr.harris@gmail.com</a>><br>
>>> An: "Discussion of Numerical Python" <<a href="mailto:numpy-discussion@scipy.org">numpy-discussion@scipy.org</a>><br>
>>> Betreff: Re: [Numpy-discussion] Silent Broadcasting considered harmful<br>
>>><br>
>>><br>
>>> On Sun, Feb 8, 2015 at 2:14 PM, Stefan Reiterer <<a href="mailto:domors@gmx.net">domors@gmx.net</a>> wrote:<br>
>>>><br>
>>>> Yeah I'm aware of that, that's the reason why I suggested a warning level<br>
>>>> as an alternative.<br>
>>>> Setting no warnings as default would avoid breaking existing code.<br>
>>>> Gesendet: Sonntag, 08. Februar 2015 um 22:08 Uhr<br>
>>>> Von: "Eelco Hoogendoorn" <<a href="mailto:hoogendoorn.eelco@gmail.com">hoogendoorn.eelco@gmail.com</a>><br>
>>>> An: "Discussion of Numerical Python" <<a href="mailto:numpy-discussion@scipy.org">numpy-discussion@scipy.org</a>><br>
>>>> Betreff: Re: [Numpy-discussion] Silent Broadcasting considered harmful<br>
>>>> > I personally use Octave and/or Numpy for several years now and never<br>
>>>> > ever needed braodcasting.<br>
>>>> But since it is still there there will be many users who need it, there<br>
>>>> will be some use for it.<br>
>>>><br>
>>>> Uhm, yeah, there is some use for it. Im all for explicit over implicit,<br>
>>>> but personally current broadcasting rules have never bothered me, certainly<br>
>>>> not to the extent of justifying massive backwards compatibility violations.<br>
>>>> Take It from someone who relies on broadcasting for every other line of<br>
>>>> code.<br>
>>>><br>
>>><br>
>>><br>
>>> It's how numpy works. It would be like getting into your car and being<br>
>>> warned that it has wheels.<br>
>>><br>
>>> Chuck<br>
>>> _______________________________________________ NumPy-Discussion mailing<br>
>>> list <a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
>>> <a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
>>><br>
>><br>
>> I agree, I do not think this is a good comparison. All cars have wheels,<br>
>> there are no surprises there. This is more like a car that decides to do<br>
>> something completely different from everything that you learned about in<br>
>> driving school.<br>
><br>
>> I find the broadcasting aspect of Numpy a turn off. If I go to add a 1x3<br>
>> vector to a 3x1 vector, I want the program to warn me or error out. I don't<br>
>> want it to do something under the covers that has no mathematical basis or<br>
>> definition. Also, Octave may provide a warning, but Matlab errors<br>
>> out..."Matrix dimensions must agree". Which they must, at least in my world.<br>
><br>
> In a previous life, many of us were very serious users of Matlab,<br>
> myself included.<br>
><br>
> Matlab / Octave have a model of the array as being a matrix, but numpy<br>
> does not have this model. There is a Matrix class that implements<br>
> this model, but usually experienced numpy users either never use this,<br>
> or stop using it.<br>
><br>
> I can only say - subjectively I know - that I did not personally<br>
> suffer from this when I switched to numpy from Matlab, partly because<br>
> I was fully aware that I was going to have to change the way I thought<br>
> about arrays, for various reasons. After a short while getting used<br>
> to it, broadcasting seemed like a huge win. I guess the fact that<br>
> other languages have adopted it means that others have had the same<br>
> experience.<br>
><br>
> So, numpy is not a straight replacement of Matlab, in terms of design.<br>
><br>
> To pursue the analogy, you have learned to drive an automatic car.<br>
> Numpy is a stick-shift car. There are good reasons to prefer a<br>
> stick-shift, but it does mean that someone trained on an automatic is<br>
> bound to feel that a stick-shift is uncomfortable for a while.<br>
<br>
<br>
</div></div>I think the analogy is Python printing at the start and all the time a warning<br>
"We use indentation, not braces, brackets or `end` to indicate blocks of code."<br>
<br>
Josef<br>
<span class="im HOEnZb"><br>
<br></span></blockquote><div><br></div><div>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. This can be a bit confusing for people who develop and implement mathematical algorithms that have a strong foundation in linear algebra, irrespective of the language they are migrating from. <br><br></div><div>With that said, I do appreciate the comments by Matthew, Eelco and others. Numpy is *not* a linear algebra package, so it does not adhere to the same mathematical definitions. This realization has cleared some things up. <br><br></div><div>-Simon<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="im HOEnZb">
<br>
><br>
> Best,<br>
><br>
> Matthew<br>
> _______________________________________________<br>
> NumPy-Discussion mailing list<br>
> <a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
> <a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</div></div></blockquote></div><br></div></div>