assign a variable to each column of an array

Dec. 17, 2007
2:58 a.m.
Is there a more concise way of assigning a variable to each column of an array? This works x,y,z = X[:,0],X[:,1],X[:,2] but seems clumsy.

December 2007
3:20 a.m.
On Dec 16, 2007 7:58 PM, elfnor <e.howick@irl.cri.nz> wrote:
Is there a more concise way of assigning a variable to each column of an array?
This works
x,y,z = X[:,0],X[:,1],X[:,2]
but seems clumsy.
You could try: x, y, z = X.T Although some people might think that's a little obscure... -- . __ . |-\ . . tim.hochberg@ieee.org
6310
Age (days ago)
6310
Last active (days ago)
1 comments
2 participants
participants (2)
-
elfnor
-
Timothy Hochberg