with open('tokyo-july-temps.csv', 'w', encoding='utf-8', newline='') as f:
i = 0
dataWriter = csv.writer(f)
for i in range(len(years)):
dataWriter.writerow([years[i],july_temps[i]])
def csv_matrix(name):
rows = []
with open(name, 'r') as f:
dataReader = csv.reader(f)
for row in dataReader:
rows.append([int(x) for x in row])
return rows
%matplotlib inline
import matplotlib.pyplot as plt
d = {'apple':10, 'banana':30, 'orange': 40, 'kiwi': 15}
x = [1,2,3,4]
plt.bar(x, d.values(), tick_label=list(d.keys()))