In this exercise, you will extract specific columns from the dataset to create a subset and verify the number of rows. This helps in focusing on relevant data for analysis.

Instructions:

  1. Create a Subset:

  2. Verify the Number of Rows:

Python Code:


# 1. Create a subset with selected columns

import pandas as pd

subset = df[['Customer ID', 'Age', 'Location', 'Purchase Amount (USD)', 'Review Rating']]

Subset.head(4)


#2. Check the number of rows in the subset:

import pandas as pd

row_count = subset.shape[0]

print("Number of Rows in Subset:", row_count)