import statistics

data = [41, 65, 64, 50, 45, 13, 29, 14, 7, 14]

print(statistics.mode(data))

###

import csv
def readData(filename):
    f = open(filename, "r")
    # Semester, 3 orig, 3 cleaned, 3 categories
    data = list(csv.reader(f))
    return data

def getCategoryCounts(data, flavor):
    counts = []
    index = data[0].index("#1 category")
    for row in range(1, len(data)):
        flavors = data[row][index:index+3]
        counts.append(flavors.count(flavor))
    return counts

data = readData("all-icecream.csv")
counts = getCategoryCounts(data, "chocolate")
print(statistics.mode(counts))

###

import matplotlib.pyplot as plt

x = [2, 4, 5, 7, 7, 9]
y = [3, 5, 4, 6, 9, 7]

plt.scatter(x, y)
plt.show()

###

labels = [ "A", "B", "C", "D", "E" ]
yValues = [ 10, 40, 36, 46, 21 ]
colors = [ "red", "yellow", "green", 
           "blue", "purple" ]
plt.bar(labels, yValues, color=colors)
plt.xlabel("Product Categories")
plt.ylabel("Counts")
plt.show()