On Fri, Nov 4, 2016 at 10:36 AM, Nathaniel Smith <n...@pobox.com> wrote:
> On Nov 4, 2016 10:32 AM, "Stephan Hoyer" <sho...@gmail.com> 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 > possible. > Couldn't it determine the dtype from the first element, and then barf later if an incompatible one shows up? And then we could adapt this code to np.array() and get nice performance with no extra functions to think about calling... And off the top of my head, I can't think of why it couldn't be generalized to the nd case as well. -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion