I\'m sure this is simple, but as a complete newbie to python, I\'m having trouble figuring out how to iterate over variables in a pandas dataframe and run a regress
pandas
Based on the accepted answer, if an index corresponding to each column is also desired:
for i, column in enumerate(df): print i, df[column]
The above df[column] type is Series, which can simply be converted into numpy ndarrays:
df[column]
Series
numpy
ndarray
for i, column in enumerate(df): print i, np.asarray(df[column])