Reputation: 6003
I have the following 2 arrays:
k=arange(1,100)
m=arange(1,100)
Then how to append or combine them into an array with 2 columns and 99 rows?
Upvotes: 2
Views: 2361
Reputation: 4653
vstack
, hstack
and transpose
are your friends for things like this.
>>> vstack([k,m]).transpose()
array([[ 1, 1],
[ 2, 2],
[ 3, 3],
...
[98, 98],
[99, 99]])
Upvotes: 6