I have a pandas dataframe as follows:
df = pd.DataFrame([ [1,2], [np.NaN,1], [\'test string1\', 5]], columns=[\'A\',\'B\'] ) df A B 0
Use the apply function of series, in order to keep them:
df = df[df['A'].apply(lambda x: len(x) <= 10)]