|
@@ -52,21 +52,18 @@
|
|
|
},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
|
+ "data_no_header = lines_list[1:len(lines_list)]\n",
|
|
|
"days_counts = dict()\n",
|
|
|
- "count = 0\n",
|
|
|
"\n",
|
|
|
- "for line in lines_list:\n",
|
|
|
- " if count != 0:\n",
|
|
|
- " split_line = line.split(\",\")\n",
|
|
|
- " day_of_week = split_line[3]\n",
|
|
|
- " num_births = int(split_line[4])\n",
|
|
|
- " \n",
|
|
|
- " if day_of_week in days_counts:\n",
|
|
|
- " days_counts[day_of_week] = days_counts[day_of_week] + num_births\n",
|
|
|
- " else:\n",
|
|
|
- " days_counts[day_of_week] = num_births\n",
|
|
|
- " if count == 0:\n",
|
|
|
- " count += 1\n",
|
|
|
+ "for line in data_no_header:\n",
|
|
|
+ " split_line = line.split(\",\")\n",
|
|
|
+ " day_of_week = split_line[3]\n",
|
|
|
+ " num_births = int(split_line[4])\n",
|
|
|
+ "\n",
|
|
|
+ " if day_of_week in days_counts:\n",
|
|
|
+ " days_counts[day_of_week] = days_counts[day_of_week] + num_births\n",
|
|
|
+ " else:\n",
|
|
|
+ " days_counts[day_of_week] = num_births\n",
|
|
|
"\n",
|
|
|
"days_counts"
|
|
|
]
|