Is there some way to get the equivalent of repmat() for ndim == 1 and ndim >2.
For ndim == 1, repmat always returns a 2-d array, instead of remaining 1-d.
For ndim >2, repmat just doesn't work.

Maybe we could add a 'reparray', with the signature:
   reparray(A, repeats, axis=None)
where repeats is a scalar or a sequence.
If 'repeats' is a scalar then the matrix is duplicated along 'axis'
that many times.
If 'repeats' is a sequence of length N, then A is duplicated
repeats[i] times along axis[i].  If axis is None then it is assumed to
be (0,1,2...N).

Er that's not quite complete, because it doesn't specify what happens
when you reparray an array to a higher dimension, like a 1-d to a 3-d.
 Like reparray([1,2], (2,2,2)).  I guess the axis parameter could have
some 'newaxis' entries to accomodate that.

--bb

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to