[Numpy-discussion] numpy.filled, again

Robert Kern robert.kern@gmail....
Sat Jun 29 16:25:22 CDT 2013


On Sat, Jun 29, 2013 at 9:55 PM, Alan G Isaac <alan.isaac@gmail.com> wrote:
>
> On 6/29/2013 3:00 PM, Nathaniel wrote:
> > any objections to np.full?
>
> Still curious:
> why isn't ``tile`` the right name?
> (It already exists.)
>
>  >>> import numpy as np
>  >>> np.tile(3.0, (2,3))
> array([[ 3.,  3.,  3.],
>         [ 3.,  3.,  3.]])
>
> If someone explained this, sorry to
> have missed it.

It's implemented inefficiently.

It is aimed at a different use case (building up arrays from other arrays)
that only incidentally, and thus poorly, fulfils this one.

It has no relation to the empty()/ones()/zeros() line of functions. In
particular, tile_like() would make no sense.

Being aimed at a different use case, it will be more difficult to find for
people who are not familiar with numpy's entire API. It will be an isolated
idiom rather than a natural completion of the existing APIs.

I can probably think of others if I really get going, but I think we're
about at the point of diminishing returns.

-- 
Robert Kern


On Sat, Jun 29, 2013 at 9:55 PM, Alan G Isaac <alan.isaac@gmail.com> wrote:

> On 6/29/2013 3:00 PM, Nathaniel wrote:
> > any objections to np.full?
>
> Still curious:
> why isn't ``tile`` the right name?
> (It already exists.)
>
>  >>> import numpy as np
>  >>> np.tile(3.0, (2,3))
> array([[ 3.,  3.,  3.],
>         [ 3.,  3.,  3.]])
>
> If someone explained this, sorry to
> have missed it.
>
> Alan
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



-- 
Robert Kern
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20130629/e9bc0047/attachment.html 


More information about the NumPy-Discussion mailing list