如何过滤数据框中的双类型行

How to filter double type rows in a dataframe

我有一个数据框,其中有一个“年龄”列,其中只有整数值是可能的。 但是,由于某些错误的原因,它在该列中带有双精度值,我想过滤掉这些行。 任何人都可以帮助我如何使用 python?

根据数据框中的双精度类型过滤行

age 15 41.1 50 output age 15 50

尝试:

output = df[df["Age"].eq(df["Age"].astype(int,errors="ignore"))]