Pandas select only numeric or integer field from dataframe

后端 未结 4 1799
栀梦
栀梦 2021-01-11 19:17

I have this Pandas dataframe (df):

     A    B
0    1    green
1    2    red
2    s    blue
3    3    yellow
4    b    black

A type is obje

4条回答
  •  执念已碎
    2021-01-11 19:45

    Personally, I think it will be more succinct to just use the built-in map compared with .apply()

    In [13]: df[map(pred, df['B'])]
    

提交回复
热议问题