-1

我想从'route_id'= 6A的df中提取所有行。

这是我尝试过的,但它返回语法错误:

 df.loc(df['route_id'] = 6A)

有小费吗?提前致谢。

4

1 回答 1

0

Looks like you've used the assignment = instead of equality test ==. The .loc needs square brackets and I also added some quotes around the '6A'

df.loc[df['route_id'] == '6A']
于 2021-02-11T21:47:00.207 回答