I have a csv file that I process this way. The csv containing just numbers is such:
1, 5, 6, 8, 45, 56
2, 6, 34, 42, 56, 98
1, 5, 6, 8, 45, 56
...
import csv
numbers = []
with open('example.csv', newline='') as f:
reader = csv.reader(f)
for row in reader:
numbers.append(row)
print(numbers)
output:
[[1, 5, 6, 8, 45, 56], [2, 6, 34, 42, 56, 98], [1, 5, 6, 8, 45, 56]]
How can I make it print the most frequently occurring lists? For example: 1, 5, 6, 8, 45, 56 2 times in list?
.count()method perhaps?