Thanks, Anne.<br><br>On Sat, Nov 7, 2009 at 1:32 PM, Anne Archibald <span dir="ltr"><<a href="mailto:peridot.faceted@gmail.com">peridot.faceted@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2009/11/7 David Goldsmith <<a href="mailto:d.l.goldsmith@gmail.com">d.l.goldsmith@gmail.com</a>>:</blockquote><div><br><snip><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> Also, my experimenting suggests that the index array ('a', the first<br><div class="im">
> argument in the func. sig.) *must* have shape (choices.shape[-1],) - someone<br>
> please let me know ASAP if this is not the case, and please furnish me w/ a<br>
> counterexample because I was unable to generate one myself.<br>
<br>
</div>It seems like a and each of the choices must have the same shape </blockquote><div><br>So in essence, at least as it presently functions, the shape of
'a' *defines* what the individual choices are within 'choices`, and if
'choices' can't be parsed into an integer number of such individual
choices, that's when an exception is raised?<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">(with<br></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

the exception that choices acn be scalars), but I would consider this<br>
a bug. </blockquote><div><br>OK, then we definitely need more people to opine on this, because, if the the two don't match, our established policy is to document *desired* behavior, not extant behavior (and file a bug ticket).  <br>
 </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Really, a and all the choices should be broadcast to the same<br>
shape. Or maybe it doesn't make sense to broadcast a - it could be<br></blockquote><div><br>Thus begging the question: does anyone actually have an extant, specific use-case?<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

valuable to know that the result is always exactly the same shape as a<br>
- but broadcasting all the choice arrays presents an important<br>
improvement of choose over fancy indexing. </blockquote><div><br>Then perhaps we need either another function, or a flag specifying which behavior this one should exhibit.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
There's a reason choose<br>
accepts a sequence of arrays as its second argument, rather than a<br>
higher-dimensional array.<br></blockquote><div><br>And that reason is probably supposed to be transparent above, but I've confused it by this point, so can you please reiterate it here, in so many words. :-)<br><br>Thanks again,<br>
<br>DG <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Anne<br>
<br>
> Thanks,<br>
><br>
> DG<br>
<div><div></div><div class="h5">><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>
><br>
><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>
</div></div></blockquote></div><br>