Skip to content

Commit

Permalink
Update NJSP plots
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-williams committed Sep 29, 2024
1 parent 844cbae commit 616eb73
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 59 deletions.
2 changes: 1 addition & 1 deletion njsp/data/year-type-county.csv
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ year,county,driver,passenger,cyclist,pedestrian,crashes
2024,Morris,7,0,1,5,13
2024,Ocean,21,4,1,11,35
2024,Passaic,14,2,0,6,21
2024,Salem,7,2,3,1,11
2024,Salem,7,3,3,1,12
2024,Somerset,9,0,0,3,12
2024,Sussex,5,2,1,2,10
2024,Union,10,2,1,9,20
Expand Down
106 changes: 50 additions & 56 deletions njsp/update-plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -261,21 +261,6 @@
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13452</th>\n",
" <td>21</td>\n",
" <td>14</td>\n",
" <td>2024-09-22 16:54:00-04:00</td>\n",
" <td>1</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>Danville Mountain Rd</td>\n",
" <td>Danville Mountain Rd</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13453</th>\n",
" <td>1</td>\n",
" <td>13</td>\n",
Expand Down Expand Up @@ -331,13 +316,28 @@
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>552</td>\n",
" <td>County 552</td>\n",
" <td>None</td>\n",
" <td>552</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13458</th>\n",
" <td>17</td>\n",
" <td>11</td>\n",
" <td>2024-09-28 02:56:00-04:00</td>\n",
" <td>1</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>State Highway 40 MP 20.5</td>\n",
" <td>None</td>\n",
" <td>40</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>9429 rows \u00d7 12 columns</p>\n",
"<p>9430 rows \u00d7 12 columns</p>\n",
"</div>"
],
"text/plain": [
Expand All @@ -349,27 +349,27 @@
"1661 20 4 2008-01-01 12:29:00-05:00 1 1 <NA> <NA> <NA> <NA> \n",
"1811 7 16 2008-01-01 18:53:00-05:00 1 <NA> <NA> <NA> <NA> <NA> \n",
"... .. .. ... .. ... ... ... ... ... \n",
"13452 21 14 2024-09-22 16:54:00-04:00 1 <NA> 1 0 0 0 \n",
"13453 1 13 2024-09-25 14:04:00-04:00 1 <NA> 1 0 0 0 \n",
"13455 4 8 2024-09-25 14:21:00-04:00 1 <NA> 0 0 1 0 \n",
"13454 4 8 2024-09-26 19:35:00-04:00 1 <NA> 0 0 1 0 \n",
"13457 6 14 2024-09-28 00:34:00-04:00 1 <NA> 0 1 0 0 \n",
"13458 17 11 2024-09-28 02:56:00-04:00 1 <NA> 0 1 0 0 \n",
"\n",
" location street highway \n",
"id \n",
"1703 State/Interstate Authority 446 S MP 1 None 446 \n",
"1681 Bergenline Ave S MP 0 at 6th St Bergenline Ave None \n",
"1659 State Highway 42 N MP 8.2 None 42 \n",
"1661 County 624 W MP 2.2 at Ikea Dr None 624 \n",
"1811 County 648 E MP .87 at Franklin Ave None 648 \n",
"... ... ... ... \n",
"13452 Danville Mountain Rd Danville Mountain Rd None \n",
"13453 State Highway 30 None 30 \n",
"13455 S. 7th St S. 7th St None \n",
"13454 Ferry Ave Ferry Ave None \n",
"13457 552 None 552 \n",
" location street highway \n",
"id \n",
"1703 State/Interstate Authority 446 S MP 1 None 446 \n",
"1681 Bergenline Ave S MP 0 at 6th St Bergenline Ave None \n",
"1659 State Highway 42 N MP 8.2 None 42 \n",
"1661 County 624 W MP 2.2 at Ikea Dr None 624 \n",
"1811 County 648 E MP .87 at Franklin Ave None 648 \n",
"... ... ... ... \n",
"13453 State Highway 30 None 30 \n",
"13455 S. 7th St S. 7th St None \n",
"13454 Ferry Ave Ferry Ave None \n",
"13457 County 552 None 552 \n",
"13458 State Highway 40 MP 20.5 None 40 \n",
"\n",
"[9429 rows x 12 columns]"
"[9430 rows x 12 columns]"
]
},
"execution_count": 5,
Expand Down Expand Up @@ -402,7 +402,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Most recent NJSP run date: 2024-09-28 10:00:04-04:00\n",
"Most recent NJSP run date: 2024-09-29 10:00:05-04:00\n",
"Most recent month end: 2024-09-01 00:00:00-04:00\n",
"Current year start: 2024-01-01 00:00:00-05:00\n",
"Next year start: 2025-01-01 00:00:00-05:00\n"
Expand Down Expand Up @@ -649,12 +649,12 @@
"1661 2008-01\n",
"1811 2008-01\n",
" ... \n",
"13452 2024-09\n",
"13453 2024-09\n",
"13455 2024-09\n",
"13454 2024-09\n",
"13457 2024-09\n",
"Name: ym, Length: 9429, dtype: object"
"13458 2024-09\n",
"Name: ym, Length: 9430, dtype: object"
]
},
"execution_count": 13,
Expand Down Expand Up @@ -831,7 +831,7 @@
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>53</td>\n",
" <td>54</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
Expand All @@ -851,7 +851,7 @@
" 6 64\n",
" 7 47\n",
" 8 63\n",
" 9 53\n",
" 9 54\n",
"\n",
"[201 rows x 1 columns]"
]
Expand Down Expand Up @@ -1032,7 +1032,7 @@
" 6 64\n",
" 7 47\n",
" 8 63\n",
" 9 53\n",
" 9 54\n",
"Name: tk, Length: 201, dtype: Int8"
]
},
Expand Down Expand Up @@ -1554,10 +1554,10 @@
" <th>2024</th>\n",
" <td>261</td>\n",
" <td>144</td>\n",
" <td>59</td>\n",
" <td>60</td>\n",
" <td>18</td>\n",
" <td>684</td>\n",
" <td>202</td>\n",
" <td>201</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
Expand All @@ -1582,7 +1582,7 @@
"2021 368 217 86 26 697 0\n",
"2022 379 191 103 16 689 0\n",
"2023 319 172 88 27 606 0\n",
"2024 261 144 59 18 684 202"
"2024 261 144 60 18 684 201"
]
},
"execution_count": 23,
Expand Down Expand Up @@ -1928,10 +1928,10 @@
" <th rowspan=\"5\" valign=\"top\">2024</th>\n",
" <th>Salem</th>\n",
" <td>7</td>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" <td>3</td>\n",
" <td>1</td>\n",
" <td>11</td>\n",
" <td>12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Somerset</th>\n",
Expand Down Expand Up @@ -1979,7 +1979,7 @@
" Camden 19 5 1 13 36\n",
" Cape May 5 0 1 3 8\n",
"... ... ... ... ... ...\n",
"2024 Salem 7 2 3 1 11\n",
"2024 Salem 7 3 3 1 12\n",
" Somerset 9 0 0 3 12\n",
" Sussex 5 2 1 2 10\n",
" Union 10 2 1 9 20\n",
Expand Down Expand Up @@ -2161,10 +2161,10 @@
" <th rowspan=\"5\" valign=\"top\">2024</th>\n",
" <th>Salem</th>\n",
" <td>7</td>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" <td>3</td>\n",
" <td>1</td>\n",
" <td>11</td>\n",
" <td>12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Somerset</th>\n",
Expand Down Expand Up @@ -2212,7 +2212,7 @@
" Camden 25 4 0 15 42\n",
" Cape May 8 3 0 0 11\n",
"... ... ... ... ... ...\n",
"2024 Salem 7 2 3 1 11\n",
"2024 Salem 7 3 3 1 12\n",
" Somerset 9 0 0 3 12\n",
" Sussex 5 2 1 2 10\n",
" Union 10 2 1 9 20\n",
Expand Down Expand Up @@ -2870,7 +2870,7 @@
" <th>2024-09</th>\n",
" <td>33</td>\n",
" <td>14</td>\n",
" <td>5</td>\n",
" <td>6</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
Expand Down Expand Up @@ -2936,7 +2936,7 @@
"2024-06 37 15 7 5\n",
"2024-07 32 11 1 3\n",
"2024-08 29 20 9 5\n",
"2024-09 33 14 5 1"
"2024-09 33 14 6 1"
]
},
"execution_count": 36,
Expand Down Expand Up @@ -3231,13 +3231,7 @@
"output_type": "stream",
"text": [
"Wrote plot JSON to www/public/plots/fatalities_by_month_lines.json\n",
"Wrote plot image to www/public/plots/fatalities_by_month_lines.png\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Wrote plot image to www/public/plots/fatalities_by_month_lines.png\n",
"Wrote plot image to www/public/plots/fatalities_by_month_lines_titled.png\n"
]
}
Expand Down
Loading

0 comments on commit 616eb73

Please sign in to comment.