Selecting multiple columns in a pandas dataframe

后端 未结 19 1781
醉话见心
醉话见心 2020-11-22 00:08

I have data in different columns but I don\'t know how to extract it to save it in another variable.

index  a   b   c
1      2   3   4
2      3   4   5
         


        
19条回答
  •  感情败类
    2020-11-22 00:29

    If you want to get one element by row index and column name, you can do it just like df['b'][0]. It is as simple as you can image.

    Or you can use df.ix[0,'b'],mixed usage of index and label.

    Note: Since v0.20 ix has been deprecated in favour of loc / iloc.

提交回复
热议问题