How to iterate over columns of pandas dataframe to run regression
for column in df:
print(df[column])
You can use iteritems()
:
for name, values in df.iteritems():
print('{name}: {value}'.format(name=name, value=values[0]))
for column in df:
print(df[column])
You can use iteritems()
:
for name, values in df.iteritems():
print('{name}: {value}'.format(name=name, value=values[0]))