<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Apr 6, 2016 at 3:21 PM Nathaniel Smith <<a href="mailto:njs@pobox.com">njs@pobox.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Can you elaborate on what you're doing that you find verbose and<br>
confusing, maybe paste an example? I've never had any trouble like<br>
this doing linear algebra with @ or dot (which have similar semantics<br>
for 1d arrays), which is probably just because I've had different use<br>
cases, but it's much easier to talk about these things with a concrete<br>
example in front of us to put everyone on the same page.<br>
<br>
-n<br></blockquote><div><br></div><div>Here's another example that I've seen catch people now and again.</div><div><br></div><div>A = np.random.rand(100, 100)</div><div>b =  np.random.rand(10)</div><div>A * b.T</div><div><br></div><div>In this case the user pretty clearly meant to be broadcasting along the rows of A</div><div>rather than along the columns, but the code fails silently. When an issue like this</div><div>gets mixed into a larger series of broadcasting operations, the error becomes</div><div>difficult to find. This error isn't necessarily unique to beginners either. It's a</div><div>common typo that catches intermediate users who know about broadcasting</div><div>semantics but weren't keeping close enough track of the dimensionality of the</div><div>different intermediate expressions in their code.</div><div><br></div><div>Best,</div><div><br></div><div>-Ian Henriksen</div><div><br></div></div></div>