data = dict()
for row in csv_reader:
page = row['page']
event_date = row['date'][:-3]
device_kind = row['device']
device_dict = data.setdefault(device_kind, {})
date_dict = device_dict.setdefault(event_date, {})
date_dict[page] = date_dict.setdefault(page,0) + 1
print(data)