Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从'route_id'= 6A的df中提取所有行。
这是我尝试过的,但它返回语法错误:
df.loc(df['route_id'] = 6A)
有小费吗?提前致谢。
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'
=
==
.loc
'6A'
df.loc[df['route_id'] == '6A']