-1

I have object contain list of numpy, like the follow:

[array([1, 2, 6]),
 array([1, 2, 7]),
 array([1, 2, 3]),
 array([3, 4, 3]),
 array([5, 6, 9]),
 array([5, 6, 7])]

How to build one numpy from them, like the follow?

[[1,2,6],
 [1,2,7],
 [1,2,3],
 [3,4,3],
 [5,6,9],
 [5,6,7]]
0

1 Answer 1

1
l = [array([1, 2, 6]),
 array([1, 2, 7]),
 array([1, 2, 3]),
 array([3, 4, 3]),
 array([5, 6, 9]),
 array([5, 6, 7])]

np.stack(l)

Output -

array([[1, 2, 6],
       [1, 2, 7],
       [1, 2, 3],
       [3, 4, 3],
       [5, 6, 9],
       [5, 6, 7]])
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.