Python threading error - must be an iterable, not int
问题 I'm trying to calculate rolling r-squared of regression among first column and other columns in a dataframe (first column and second, first column and third etc.) But when I try threading, it kept telling me the error that TypeError: ParallelRegression() argument after * must be an iterable, not int". I'm wondering how do I fix this? Thanks very much! import threading totalThreads=3 #three different colors def ParallelRegression(threadnum): for i in range(threadnum): res[:,i]=sm.OLS(df.iloc[: