I have a 3D np arrays like this :
x= array([[[ 1., 2., 3.],
[ 4., 5., 6.],
[ 7., 8., 9.],
[ 10., 11., 12.]],
[[ 13., 14., 15.],
[ 16., 17., 18.],
[ 19., 20., 21.],
[ 22., 23., 24.]]])
I would like to repeat my array n times ( eg 3 times) like this :
array([[[ 1., 2., 3.],
[ 4., 5., 6.],
[ 7., 8., 9.],
[ 10., 11., 12.]],
[[ 1., 2., 3.],
[ 4., 5., 6.],
[ 7., 8., 9.],
[ 10., 11., 12.]],
[[ 1., 2., 3.],
[ 4., 5., 6.],
[ 7., 8., 9.],
[ 10., 11., 12.]],
[[ 13., 14., 15.],
[ 16., 17., 18.],
[ 19., 20., 21.],
[ 22., 23., 24.]],
[[ 13., 14., 15.],
[ 16., 17., 18.],
[ 19., 20., 21.],
[ 22., 23., 24.]]
[[ 13., 14., 15.],
[ 16., 17., 18.],
[ 19., 20., 21.],
[ 22., 23., 24.]]])
I have tried like this :
xx=np.vstack([x]*3)
print xx.reshape(6,4,3)
array([[[ 1., 2., 3.],
[ 4., 5., 6.],
[ 7., 8., 9.],
[ 10., 11., 12.]],
[[ 13., 14., 15.],
[ 16., 17., 18.],
[ 19., 20., 21.],
[ 22., 23., 24.]],
[[ 1., 2., 3.],
[ 4., 5., 6.],
[ 7., 8., 9.],
[ 10., 11., 12.]],
[[ 13., 14., 15.],
[ 16., 17., 18.],
[ 19., 20., 21.],
[ 22., 23., 24.]],
[[ 1., 2., 3.],
[ 4., 5., 6.],
[ 7., 8., 9.],
[ 10., 11., 12.]],
[[ 13., 14., 15.],
[ 16., 17., 18.],
[ 19., 20., 21.],
[ 22., 23., 24.]]])
How can I get in the order what I want, there should be the easy way to do this. Thanks in advance for your suggestions.