take subset of columns pandas code example
Example 1: select columns to include in new dataframe in python
new = old[['A', 'C', 'D']].copy()
Example 2: select columns pandas
df1 = df.iloc[:,0:2] # Remember that Python does not slice inclusive of the ending index.