input: Write a function to create a recommendation system in Python using Pandas to recommend new products to customers based on past purchases. The system should implement an item-based collaborative filter and recommend the nearest 3 products for each product in the dataset.
  assert create_recommendation_system('product_data.csv')==True
  assert create_recommendation_system('empty_data.csv')==False
  assert create_recommendation_system('invalid_format.txt')==False
  assert create_recommendation_system('small_data.csv')==True
  assert create_recommendation_system('large_data.csv')==True
output: 
  def create_recommendation_system(file_path):
      try:
          import pandas as pd
          from sklearn.metrics.pairwise import cosine_similarity
          
          df = pd.read_csv(file_path)
          
          if df.empty:
              return False
          
          pivot_table = df.pivot_table(index='customer_id', columns='product_id', values='purchase_count')
          pivot_table = pivot_table.fillna(0)
          
          item_similarity = cosine_similarity(pivot_table.T)
          item_similarity_df = pd.DataFrame(item_similarity, index=pivot_table.columns, columns=pivot_table.columns)
          
          recommendations = {}
          for product in item_similarity_df.index:
              similar_products = item_similarity_df.loc[product].sort_values(ascending=False).drop(product).head(3).index.tolist()
              recommendations[product] = similar_products
          
          return True
      except:
          return False
  