On 8/17/07, Barry Wark <[EMAIL PROTECTED]> wrote:
>
> Is there a reason not to add an argument to fromiter that specifies
> the final size of the n-d array? Reading this discussion, I realized
> that there are several places in my code where I create 2-D arrays
> like this:
>
> arr = N.array([d.dat
Is there a reason not to add an argument to fromiter that specifies
the final size of the n-d array? Reading this discussion, I realized
that there are several places in my code where I create 2-D arrays
like this:
arr = N.array([d.data() for d in list_of_data_containers]),
where d.data() returns
On 8/17/07, Robert Kern <[EMAIL PROTECTED]> wrote:
> Geoffrey Zhu wrote:
> > Hi All,
> >
> > I want to construct a numpy array based on Python objects. In the
> > below code, opts is a list of tuples.
> >
> > For example,
> >
> > opts=[ ('C', 100, 3, 'A'), ('K', 200, 5.4, 'B')]
> >
> > If I use a g
Geoffrey Zhu wrote:
> Hi All,
>
> I want to construct a numpy array based on Python objects. In the
> below code, opts is a list of tuples.
>
> For example,
>
> opts=[ ('C', 100, 3, 'A'), ('K', 200, 5.4, 'B')]
>
> If I use a generator like the following:
>
> K=numpy.array(o[2]/1000.0 for o in
On Thu, 16 Aug 2007, Geoffrey Zhu apparently wrote:
> K=numpy.array(o[2]/1000.0 for o in opts)
> It does not work.
K=numpy.fromiter((o[2]/1000.0 for o in opts),'float')
hth,
Alan Isaac
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
ht
Hi All,
I want to construct a numpy array based on Python objects. In the
below code, opts is a list of tuples.
For example,
opts=[ ('C', 100, 3, 'A'), ('K', 200, 5.4, 'B')]
If I use a generator like the following:
K=numpy.array(o[2]/1000.0 for o in opts)
It does not work.
I have to use:
nu