input: Write a function to create a recommendation system in Python using Pandas that recommends new products to customers based on their past purchases. The function should read data from a CSV file, create an item-based collaborative filter using NearestNeighbors, and make recommendations for each item. The output should print recommendations for each item in the dataset.
  assert recommend_products('product_data.csv')==None
  assert recommend_products('empty_data.csv')==None
  assert recommend_products('large_dataset.csv')==None
output: def recommend_products(file_path):
      import pandas as pd
      from sklearn.neighbors import NearestNeighbors
      
      try:
          df = pd.read_csv(file_path)
          pivot_table = df.pivot_table(index='customer_id', columns='product_id', values='purchase_count')
          pivot_table = pivot_table.fillna(0)
          
          model_knn = NearestNeighbors(metric='cosine', algorithm='brute')
          model_knn.fit(pivot_table)
          
          for product in pivot_table.columns:
              product_series = pivot_table[product]
              distances, indices = model_knn.kneighbors([product_series], n_neighbors=6)
              recommendations = []
              for i in range(1, len(distances.flatten())):
                  recommendations.append(pivot_table.columns[indices.flatten()[i]])
              print(f"Recommendations for product {product}: {recommendations}")
      except Exception as e:
          pass