data = pd.DataFrame([[1, 2, np.nan], [np.nan, np.nan, 6]], columns=['a1',
    'b', 'a2'])
vars = [col for col in list(data) if col.startswith('a')]
Trying to select data from all columns that start with string from a pandas dataframe