how to get only 2 columns from a dataframe pandas code example Example: df only take 2 columns df1 = df[['a', 'b']]