Remove rows where column value type is string Pandas

前端 未结 4 2013
暗喜
暗喜 2020-12-17 10:21

I have a pandas dataframe. One of my columns should only be floats. When I try to convert that column to floats, I\'m alerted that there are strings in there. I\'d like to d

4条回答
  •  悲&欢浪女
    2020-12-17 10:55

    You can find the data type of a column from the dtype.kind attribute. Something like df[col].dtype.kind. See the numpy docs for more details. Transpose the dataframe to go from indices to columns.

提交回复
热议问题