input: Write a python function to classify the gender of a customer based on their purchase history using the provided data.
  ```python
  import pandas as pd
  
  def classify_customer_gender(purchases):
      item_counts = purchases.groupby('item').count()
      prob_items = item_counts / len(purchases)
      prob_gender = purchases.groupby('gender').count() / len(purchases)
      prob_gender_given_items = (purchases.groupby(['item','gender']).count() / len(purchases)).divide(prob_items, axis=0)
      customer_gender = prob_gender_given_items['price']['Lipstick', 'Wine Glasses', 'Cap'].multiply(prob_gender['price']).idxmax()
      return customer_gender
  
  # Test cases
  purchases1 = pd.DataFrame({
      'item' : ["Lipstick", "Wine Glasses", "Cap"],
      'price': [10, 20, 15],
      'gender': [0, 1, 0]
  })
  assert classify_customer_gender(purchases1) == 0
  
  purchases2 = pd.DataFrame({
      'item' : ["Lipstick", "Wine Glasses", "Cap", "Lipstick", "Lipstick"],
      'price': [10, 20, 15, 10, 10],
      'gender': [1, 0, 1, 1, 1]
  })
  assert classify_customer_gender(purchases2) == 1
  
  purchases3 = pd.DataFrame({
      'item' : ["Wine Glasses", "Wine Glasses", "Cap", "Lipstick"],
      'price': [20, 20, 15, 10],
      'gender': [1, 1, 0, 0]
  })
  assert classify_customer_gender(purchases3) == 1
output: def classify_customer_gender(purchases):
      item_counts = purchases.groupby('item').count()
      prob_items = item_counts / len(purchases)
      prob_gender = purchases.groupby('gender').count() / len(purchases)
      prob_gender_given_items = (purchases.groupby(['item','gender']).count() / len(purchases)).divide(prob_items, axis=0)
      prob_gender_given_items = prob_gender_given_items.fillna(0)  # Handle NaN values
      customer_gender = prob_gender_given_items['price'].loc[['Lipstick', 'Wine Glasses', 'Cap']].multiply(prob_gender['price'], axis=1).sum().idxmax()
      return customer_gender