On Fri, Nov 4, 2016 at 10:36 AM, Nathaniel Smith wrote:
> On Nov 4, 2016 10:32 AM, "Stephan Hoyer" wrote:
> > fromiter dynamically resizes a NumPy array, like a Python list, except
> with a growth factor of 1.5
>
> Oh, right, and the dtype argument is mandatory, which is what makes this
> poss
On Nov 4, 2016 10:32 AM, "Stephan Hoyer" wrote:
>
> On Fri, Nov 4, 2016 at 10:24 AM, Nathaniel Smith wrote:
>>
>> Are you sure fromiter doesn't make an intermediate list or equivalent?
It has to collect all the values before it can know the shape or dtype of
the array to put them in.
>
> fromiter
On Fri, Nov 4, 2016 at 10:24 AM, Nathaniel Smith wrote:
> Are you sure fromiter doesn't make an intermediate list or equivalent? It
> has to collect all the values before it can know the shape or dtype of the
> array to put them in.
>
fromiter dynamically resizes a NumPy array, like a Python list
Are you sure fromiter doesn't make an intermediate list or equivalent? It
has to collect all the values before it can know the shape or dtype of the
array to put them in.
On Nov 4, 2016 5:26 AM, "Francesc Alted" wrote:
2016-11-04 13:06 GMT+01:00 Neal Becker :
> I find I often write:
> np.arra
On Fri, Nov 4, 2016 at 6:36 AM, Neal Becker wrote:
>
> Francesc Alted wrote:
>
> > 2016-11-04 13:06 GMT+01:00 Neal Becker :
> >
> >> I find I often write:
> >> np.array ([some list comprehension])
> >>
> >> mainly because list comprehensions are just so sweet.
> >>
> >> But I imagine this isn't pa
Francesc Alted wrote:
> 2016-11-04 14:36 GMT+01:00 Neal Becker :
>
>> Francesc Alted wrote:
>>
>> > 2016-11-04 13:06 GMT+01:00 Neal Becker :
>> >
>> >> I find I often write:
>> >> np.array ([some list comprehension])
>> >>
>> >> mainly because list comprehensions are just so sweet.
>> >>
>> >> Bu
On Fri, Nov 4, 2016 at 9:04 AM, Stephan Hoyer wrote:
> On Fri, Nov 4, 2016 at 7:12 AM, Francesc Alted wrote:
>
>> Does this generalize to >1 dimensions?
>>>
>>
>> A reshape() is not enough? What do you want to do exactly?
>>
>
> np.fromiter takes scalar input and only builds a 1D array. So it a
On 4 November 2016 at 16:04, Stephan Hoyer wrote:
>
> But, we also don't have an unstack function. This would mostly be syntactic
> sugar, but I think it would be a nice addition. Such a function actually
> exists in TensorFlow:
> https://g3doc.corp.google.com/third_party/tensorflow/g3doc/api_docs
On Fri, Nov 4, 2016 at 7:12 AM, Francesc Alted wrote:
> Does this generalize to >1 dimensions?
>>
>
> A reshape() is not enough? What do you want to do exactly?
>
np.fromiter takes scalar input and only builds a 1D array. So it actually
can't combine multiple values at once unless they are flat
2016-11-04 14:36 GMT+01:00 Neal Becker :
> Francesc Alted wrote:
>
> > 2016-11-04 13:06 GMT+01:00 Neal Becker :
> >
> >> I find I often write:
> >> np.array ([some list comprehension])
> >>
> >> mainly because list comprehensions are just so sweet.
> >>
> >> But I imagine this isn't particularly e
Francesc Alted wrote:
> 2016-11-04 13:06 GMT+01:00 Neal Becker :
>
>> I find I often write:
>> np.array ([some list comprehension])
>>
>> mainly because list comprehensions are just so sweet.
>>
>> But I imagine this isn't particularly efficient.
>>
>
> Right. Using a generator and np.fromiter(
2016-11-04 13:06 GMT+01:00 Neal Becker :
> I find I often write:
> np.array ([some list comprehension])
>
> mainly because list comprehensions are just so sweet.
>
> But I imagine this isn't particularly efficient.
>
Right. Using a generator and np.fromiter() will avoid the creation of the
inter
12 matches
Mail list logo