Feature name extraction directly from dataset
If you are reading in a csv, try;

data = pd.read_csv('filepath', header=None)


Then you can do what you were doing to read the features from the first line