python – subset specific columns name in a dataframe

columns = ['b', 'c']
df1 = pd.DataFrame(df, columns=columns)

Here is what the above code is Doing:
1. We’re creating a new DataFrame called df1.
2. We’re specifying the columns that we want to keep in df1.
3. We’re using the DataFrame df as the source for the data in df1.
4. We’re specifying that we want to keep the columns ‘b’ and ‘c’ from df.

Note that the order of the columns in df1 is the same as the order of the columns in df.