names = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l']
df = pd.read_csv(StringIO(data), header=None, names=names)
mask = df.applymap(lambda x: x in ['X', 'XX', None, np.nan])
removing particular rows from DataFrame in python pandas