Zho*_*Xie 4 python select list loc pandas
我有一张桌子 df
a b c
1 x y [x]
2 x z [c,d]
3 x t [e,f,g]
Run Code Online (Sandbox Code Playgroud)
只是想知道如何使用 c 列的长度选择行
如
df.loc[len(df.c) >1]
Run Code Online (Sandbox Code Playgroud)
我知道这是不对的......什么应该是正确的?
小智 19
尝试这个:
df[df.c.map(len)>1]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6436 次 |
| 最近记录: |