Python pandas: exclude rows below a certain frequency count

前端 未结 3 1003
面向向阳花
面向向阳花 2020-12-08 05:29

So I have a pandas DataFrame that looks like this:

r vals    positions
1.2       1
1.8       2
2.3       1
1.8       1
2.1       3
2.0       3
1.9       1
..         


        
3条回答
  •  感动是毒
    2020-12-08 05:54

    How about selecting all position rows with values >= 20

    mask = df['position'] >= 20
    sel = df.ix[mask, :]
    

提交回复
热议问题