Objective:

Learn how to select specific columns from a DataFrame in Pandas.


Task : Column Selection

  1. Select the following columns from the given DataFrame:

  2. Display the first 5 rows of the result.

Python Code:

import pandas as pd

selected_columns = df[['Customer ID', 'Age', 'Purchase Amount (USD)']]

selected_columns.head(5)