0

My input array is: [ 37. -18. 27.]

Now I wanted to create such array (every value four times): [ 37. 37. 37. 37. -18. -18. -18. -18. 27. 27. 27. 27.]

import numpy as np
abc = (37.0, -18.0, 27.0)
xyz = np.array(abc)
for i in range(len(xyz)):
    four = (xyz[i], xyz[i], xyz[i], xyz[i])

Now, the output isn't the right one. I want to have an one-dimensional array as a result. Does somebody have an idea?

2
  • Where can I find this answer? Commented Oct 7, 2014 at 13:17
  • Please, give me a link. Commented Oct 7, 2014 at 13:18

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.