Remove non-numeric rows in one column with pandas

Using pd.to_numeric

In [1079]: df[pd.to_numeric(df['id'], errors="coerce").notnull()]
Out[1079]:
  id  name
0  1     A
1  2     B
2  3     C
4  4     E
5  5     F

Leave a Comment