If you specifically need len
, then @MaxU's answer is best.
For a more general solution, you can use the map method of a Series.
df[df['amp'].map(len) == 495]
This will apply len
to each element, which is what you want. With this method, you can use any arbitrary function, not just len
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…