How to iterate over columns of pandas dataframe to run regression

后端 未结 8 1824
Happy的楠姐
Happy的楠姐 2021-01-29 18:07

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

8条回答
  •  醉梦人生
    2021-01-29 18:25

    Using list comprehension, you can get all the columns names (header):

    [column for column in df]

提交回复
热议问题