Objective:

Learn how to count the number of missing (NaN) values in a specific column after applying a conditional operation.


Task:

  1. Identify the number of rows that have NaN in the Purchase Amount (USD) column after replacing values below $50.

  2. Print the total count of such rows.

Python Code:

import pandas as pd

import numpy as np

nan_count = df['Purchase Amount (USD)'].isna().sum()

print("Number of rows with NaN in 'Purchase Amount (USD)':", nan_count)