[Numpy-discussion] Matlab -> NumPy translation and indexing

Timothy Hochberg tim.hochberg at ieee.org
Wed Mar 14 11:08:31 EDT 2007


On 3/14/07, David Koch <ogdude at googlemail.com> wrote:
>
> On 3/14/07, Sven Schreiber <svetosch at gmx.net> wrote:
> >
> >
> >
> > If you want a 1d-array in the end you could try empty(0) to start with,
> > and then do hstack((A, your_scalar)) or something like that.
>
>

Depending on what your generating routine looks like, you might also try "a
= fromiter(...)" where you package up your scalar source as an iterator.




-- 

//=][=\\

tim.hochberg at ieee.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070314/3327a3a0/attachment.html>


More information about the NumPy-Discussion mailing list