pandas dataframe select columns from table code example
Example 1: select DF columns python
df = df.iloc[:,0:2]
df = df[['column1', 'column2']]
Example 2: select columns pandas
df1 = df.iloc[:,0:2] # Remember that Python does not slice inclusive of the ending index.