import pandas as pd
from apyori import apriori

data = pd.read_csv('ecommerce.csv', header=None)

records = []
for i in range(0, len(data)):  
    records.append([str(data.values[i,j]) for j in range(0, len(data.columns))])

rules = apriori(records, min_length=2, min_lift=1.1, min_support=0.15)  
results = list(rules)  

for item in results:
  if not 'nan' in str(item):
   print()
   print(item)
   print()
   print("-----------------------")
