select columns pandas value or code example
Example 1: select columns pandas
df1 = df.iloc[:,0:2] # Remember that Python does not slice inclusive of the ending index.
Example 2: df only take 2 columns
df1 = df[['a', 'b']]
df1 = df.iloc[:,0:2] # Remember that Python does not slice inclusive of the ending index.
df1 = df[['a', 'b']]