[Numpy-discussion] Re: repmat equivalent?

Albert Strasheim fullung at gmail.com
Thu Feb 23 04:41:13 EST 2006


Hello all

Just to clear up any confusion:

On 2/23/06, Albert Strasheim <fullung at gmail.com> wrote:

> Here are some test cases that the current repmat should pass, but doesn't:
>
> a = repmat(1, 1, 1)
> assert_equal(a, 1)
> a = repmat(array([1]), 1, 1)
> assert_array_equal(a, array([1]))
> a = repmat(array([1,2]), 2, 3)
> assert_array_equal(a, array([[1,2,1,2,1,2], [1,2,1,2,1,2]]))
> a = repmat(array([[1,2],[3,4]]), 2, 3)
> assert_array_equal(a, array([[1,2,1,2,1,2], [3,4,3,4,3,4],
> [1,2,1,2,1,2], [3,4,3,4,3,4]]))

Only the first two tests fail. The other two pass. Presumably any test
that uses a matrix with more than 2 dimensions will also fail.

Regards

Albert




More information about the NumPy-Discussion mailing list