return column in dataframe by column name python code example
Example 1: pd dataframe get column names
lst = data.columns.values # data is dataframe
Example 2: print columns pandas
df = pd.DataFrame(exam_data , index=labels)
# print the columns labeled "name" and "score"
print(df[['name', 'score']])