df.columns use code example
Example 1: create dataframe panndas
import pandas as pd
data = {'First Column Name': ['First value', 'Second value',...],
'Second Column Name': ['First value', 'Second value',...],
....
}
df = pd.DataFrame (data, columns = ['First Column Name','Second Column Name',...])
print (df)
Example 2: select columns pandas
df1 = df.iloc[:,0:2] # Remember that Python does not slice inclusive of the ending index.