I'm trying to work out how to add multiple lists to an array. Following is what I've come up with but it's not working.
import math
import numpy as np
myList1 = [1,2,'nan']
myList2 = [3,4,5]
class myThing(object):
def __init__(self, myLists=[]): #This could accept 1 or many lists
self.__myVars = np.array(myLists, dtype=float)
self.__myVars.shape = (len(myLists),3)
self.__myVars = np.vstack(myVars)
@property
def myVars(self):
return self.__myVars
foo = myThing(myList1,myList2)
print foo.myVars
blah blah...
TypeError: __init__() takes at most 2 arguments (3 given)
Help appreciated