choose columns from dataframe code example
Example 1: python: select specific columns in a data frame
df = df[["Column_Name1", "Column_Name2"]]
Example 2: select columns to include in new dataframe in python
new = old[['A', 'C', 'D']].copy()
Example 3: select columns to include in new dataframe in python
new = old.filter(['A','B','D'], axis=1)