Home > Back-end >  How to filter double type rows in a dataframe
How to filter double type rows in a dataframe

Time:12-23

I have a dataframe that has an "age" column in which only integer values ​​are possible. However, for some wrong reason it comes with double values ​​in this column and I want to filter those rows out. Anyone can help me how to filter rows based on double type in a dataframe using python?

age 15 41.1 50 output age 15 50

CodePudding user response:

Try:

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