如何根据列中的计算返回pandas中的某些行

时间:2018-02-14 00:25:36

标签: python python-3.x pandas

我想对我的pandas数据框中的列执行操作,并且我想从第一个位置通过该操作的行的另一列中获取信息列表,这是一种奇怪的解释方法,请看一下这个图表:

enter image description here

我将如何做到这一点?

2 个答案:

答案 0 :(得分:0)

这应该有效:

df = pd.read_csv('file.csv')
lst = df.loc[df['Speed'] > 10, 'No. Plat'].tolist()

答案 1 :(得分:0)

这就是你所追求的?

df.loc[df.Speed>10, 'No. Plate'].tolist()