In [1]: import pandas as pd
In [2]: import numpy as np
In [3]: students = [ ('jack', 'Apples' , 34) ,
...: ('Riti', 'Mangos' , 31) ,
...: ('Aadi', 'Grapes' , 30) ,
...: ('Sonia', 'Apples', 32) ,
...: ('Lucy', 'Mangos' , 33) ,
...: ('Mike', 'Apples' , 35)
...: ]
In [4]: #Create a DataFrame object
...: dfObj = pd.DataFrame(students, columns = ['Name' , 'Product', 'Sale'])
In [5]: condition = dfObj.apply(lambda s: pd.to_numeric(s, errors='coerce').notn
...: ull().all()).to_dict()
In [6]: dfObj[[k for k,v in condition.items() if v]]
Out[6]:
Sale
0 34
1 31
2 30
3 32
4 33
5 35