Dear all-

I am writing a function as follows.

def getdata(varlist):

....
eventually I have a variable called "data", which have exactly the same
number of columns as the name of variables in varlist.
Say  varlist=['var1','var2','var3']. I want to assign var1=data[:,0],
var2=data[:,1], var3=data[:2] and return var1, var2, var3.

But when I write the function, I only know I want to assign data[:,0] to a
variable which has a name as varlist[0]. How to write this?

Thank you!

Deer
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to