-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLab6.py
More file actions
54 lines (40 loc) · 926 Bytes
/
Lab6.py
File metadata and controls
54 lines (40 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import pandas as pd
import numpy as np
import pyfpgrowth
df = pd.read_csv('dataset.csv', delimiter=';')
df = df.drop('ID', axis=1)
df = df.TRANSACTION
df=df.tolist()
print(df)
df = [line.split(',') for line in df]
print(df)
patterns = pyfpgrowth.find_frequent_patterns(df, 2)
print(patterns)
# transactions = [[1, 2, 5],
# [2, 4],
# [2, 3],
# [1, 2, 4],
# [1, 3],
# [2, 3],
# [1, 3],
# [1, 2, 3, 5],
# [1, 2, 3]]
#
# print(transactions)
#
# patterns = pyfpgrowth.find_frequent_patterns(transactions, 2)
#
# print(patterns)
# import pandas as pd
# import numpy as np
# import pyfpgrowth
#
# df = pd.read_csv('GroceryStoreDataSet.csv')
#
#
# Products_list = df.values.tolist()
# #print(Products_list)
#
# patterns = pyfpgrowth.find_frequent_patterns(Products_list,2)
#
# print(patterns)