1def no_blank(fd):
2 try:
3 while True:
4 line = next(fd)
5 if len(line.strip()) != 0:
6 yield line
7 except:
8 return
9#Read the CSV file.
10with open('campaign_monthly_report.csv', 'r') as csv_file:
11 csv_reader = csv.DictReader(no_blank(csv_file))