I have a dataframe where there are special characters (like a square) in one of the columns EPI_ID
. I want to remove all rows that contain this special character. This isn't a standard character and I haven't found issues similar to this in a dataframe, mostly as strings. Nevertheless, I am having trouble identifying these columns. Any suggestions?
df
EPI_ID stuff
2342F randoM_words
FER43 predictive_words
u'\u25A1' blank
My attempt:
df[~df['EPI_ID'].apply(lambda x: x.encode('ascii') == True)]
My results are throwing False for every row.
Expected output:
EPI_ID stuff
2342F randoM_words
FER43 predictive_words
Edit: the square doesn't come up in the mock df. But this is what it is square