<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>My point is also that we need to make sure the broadcasting rules are consistent for both addition and array copy.   </div><div><div><br></div><div>Addition would not create an error if a (1,20) array was added to a (20,) array.   Therefore, a (1,20) array can also copied into a (20,) array --- as can a (1,1,1,1,20) array.   Conversely, a (20,1) or a (1,1,20,1,1) array can not be copied into a (20,) array. </div><div><br></div><div>For the purposes of assignment, NumPy was designed so that if the rhs and lhs could be broadcast to the same shape, then the assignment could proceed: otherwise, it would fail. </div><div><br></div><div>This behavior should not change in 1.6.  </div><div><br></div><div>-Travis</div><div><br></div><div><br></div><div><br><div><div><div>On Mar 5, 2011, at 8:51 PM, Charles R Harris wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div class="gmail_quote">On Sat, Mar 5, 2011 at 7:41 PM, Charles R Harris <span dir="ltr"><<a href="mailto:charlesr.harris@gmail.com">charlesr.harris@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br><br><div class="gmail_quote"><div class="im">On Sat, Mar 5, 2011 at 7:23 PM, Enthought <span dir="ltr"><<a href="mailto:oliphant@enthought.com" target="_blank">oliphant@enthought.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div bgcolor="#FFFFFF"><div>This should be changed back so that the former works and the later does not.   It was intentional that the former worked --- it was consistent with broadcasting rules.</div><div><br></div><div>

A (1,20) array can be interpreted as a (20,) array.</div><div><br></div></div></blockquote></div><div><br>So should a (1,1,1,1,20) array also be interpreted as a (20,) array? From what you say, an arbitrary number of 1's can not only be appended on the left, the usual broadcasting, but an arbitrary number of 1's can also be removed. Is that so?<br>

<br></div></div></blockquote><div><br>The point being, that assignment is now a special case that does not follow the same rules as, say, addition.<br><br>Chuck <br></div><br></div>
_______________________________________________<br>NumPy-Discussion mailing list<br><a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>http://mail.scipy.org/mailman/listinfo/numpy-discussion<br></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div>---</div><div>Travis Oliphant</div><div>Enthought, Inc.</div><div><a href="mailto:oliphant@enthought.com">oliphant@enthought.com</a></div><div>1-512-536-1057</div><div><a href="http://www.enthought.com">http://www.enthought.com</a></div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br></div></div></div></body></html>