I am having below ct_data dataframe
imjp_number,imct_id
182467224,'ed3baabac3ce4d86801d8490ea474963|pXJjGxufodMVq5FBSzHc2A'
307291224,'__gde66a472fe104ab381456ee059751d9d|Qujk8BKa0XkkpJMCstCYBw'
214278175,'mbKKbkKpiTsIAyCE8y07rw|e8133ceeca654d169532b4ad4de661d5'
tes123456,'tMyM0un_ptsHHC-lET6tkQ|87538a4436af47a7a9b8b9bc2b3ec5ba'
Not Found,'pXJjGxufodMVq5FBSzHc2A'
I am applying below logic but it's not working.
ct_data['imjp_number'] = ct_data.loc[ct_data['imjp_number'].apply(lambda x: isinstance(x,int)), 'imjp_number']
Please suggest me best way to select ct_data df having integer value only and remove 'tes12345' and 'Not found' value from imjp_number columns
ct_data[ct_data.imjp_number.str.isdigit()]. https://pandas.pydata.org/docs/user_guide/text.html#text-string-methodsct_data.imjp_number.str.isdigit()creates a boolean Series.ct_data[ct_data.imjp_number.str.isdigit()]Will return a DataFrame without those two rows. https://pandas.pydata.org/docs/user_guide/indexing.html#boolean-indexing