Python Pandas iterate over rows and access column names

前端 未结 4 1289
南笙
南笙 2020-12-03 00:35

I am trying to iterate over the rows of a Python Pandas dataframe. Within each row of the dataframe, I am trying to to refer to each value along a row by its column name.

4条回答
  •  时光说笑
    2020-12-03 01:29

    for i in range(1,len(na_rm.columns)):
               print ("column name:", na_rm.columns[i])
    

    Output :

    column name: seretide_price
    column name: symbicort_mkt_shr
    column name: symbicort_price
    

提交回复
热议问题