How do I pass a list to a __init__ value/definition?

ryanshewcraft at gmail.com ryanshewcraft at gmail.com
Tue Jul 25 09:03:16 EDT 2006


You guys are right it is getting passed initially.  I checked in by
printing the self.regressors in the class and it gives the list.  But I
get the error:  TypeError: iteration over non-sequence for

def Regress(self):
        print self.regressors
        for reg in self.regressors:
            index = HedgeFund(self.dbh, reg)
            indexTS[reg] =  FundReturnSeries(dbh,index, sd, ed)
            indexNames[reg] = index.Name()
            header.append(index.Name())
            header.append("t-statistic")
        header.append("r-squared")
        fh_csv.writerow(header)

and when I print self.regressors here it only gives me the first number
in the list.  This bit of code is directly below the __init__ method.
Any ideas what I'm doing wrong?  Thanks for the quick response so far.




More information about the Python-list mailing list