On Mon, Jan 14, 2013 at 1:12 PM, Pierre Haessig <pierre.haes...@crans.org> wrote: > In [8]: tile(nan, (3,3)) # (it's a verb ! )
tile, in my opinion, is useful in some cases (for people who think in terms of repmat()) but not very NumPy-ish. What I'd like is a function that takes - an initial array_like "a" - a shape "s" - optionally, a dtype (otherwise inherit from a) and broadcasts "a" to the shape "s". In the case of scalars this is just a fill. In the case of, say, a (5,) vector and a (10, 5) shape, this broadcasts across rows, etc. I don't think it's worth special-casing scalar fills (except perhaps as an implementation detail) when you have rich broadcasting semantics that are already a fundamental part of NumPy, allowing for a much handier primitive. David _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion