[Numpy-discussion] New numpy functions: filled, filled_like
Mon Jan 14 12:56:54 CST 2013
On Mon, Jan 14, 2013 at 1:12 PM, Pierre Haessig
> In : 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
- 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
More information about the NumPy-Discussion