<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Nov 4, 2016 at 9:04 AM, Stephan Hoyer <span dir="ltr"><<a href="mailto:shoyer@gmail.com" target="_blank">shoyer@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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Fri, Nov 4, 2016 at 7:12 AM, Francesc Alted <span dir="ltr"><<a href="mailto:faltet@gmail.com" target="_blank">faltet@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="m_-6370060395689901102gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Does this generalize to >1 dimensions?<br></blockquote><div><br></div></span><div>A reshape() is not enough?  What do you want to do exactly?</div></div></div></div></blockquote><div><br></div></span><div>np.fromiter takes scalar input and only builds a 1D array. So it actually can't combine multiple values at once unless they are flattened out in Python. It could be nice to add support for non-scalar inputs, stacking them similarly to np.array. Likewise, it could be nice to add an axis argument, so it can work similarly to np.stack.</div></div></div></div></blockquote><div><br></div><div> itertools.product, itertools.permutation, etc. with np.fromiter (and reshape) is probably also useful here, though it doesn't solve the non-scalar problem.</div><div><br></div><div>Ryan</div></div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Ryan May<br><br></div></div></div>
</div></div>