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 Nov 3, 2024
1 parent 9869243 commit 4785dff
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 42 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 @@ -346,7 +346,7 @@ year,county,driver,passenger,cyclist,pedestrian,crashes
2024,Hudson,8,2,0,4,13
2024,Hunterdon,4,2,0,2,8
2024,Mercer,13,5,1,8,26
2024,Middlesex,23,10,1,18,46
2024,Middlesex,24,10,1,18,47
2024,Monmouth,20,5,4,14,42
2024,Morris,8,1,1,5,15
2024,Ocean,25,4,1,11,39
Expand Down
86 changes: 47 additions & 39 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>13524</th>\n",
" <td>7</td>\n",
" <td>22</td>\n",
" <td>2024-10-29 23:59: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>County 636</td>\n",
" <td>None</td>\n",
" <td>636</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13523</th>\n",
" <td>9</td>\n",
" <td>6</td>\n",
Expand Down Expand Up @@ -335,9 +320,24 @@
" <td>None</td>\n",
" <td>46</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13533</th>\n",
" <td>12</td>\n",
" <td>21</td>\n",
" <td>2024-11-02 13:44: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>New Road</td>\n",
" <td>New Road</td>\n",
" <td>None</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>9499 rows \u00d7 12 columns</p>\n",
"<p>9500 rows \u00d7 12 columns</p>\n",
"</div>"
],
"text/plain": [
Expand All @@ -349,11 +349,11 @@
"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",
"13524 7 22 2024-10-29 23:59:00-04:00 1 <NA> 0 1 0 0 \n",
"13523 9 6 2024-10-30 00:18:00-04:00 1 <NA> 0 0 1 0 \n",
"13525 18 5 2024-10-30 20:30:00-04:00 1 <NA> 0 0 1 0 \n",
"13531 9 6 2024-10-31 08:55:00-04:00 1 <NA> 1 0 0 0 \n",
"13530 16 14 2024-10-31 20:47:00-04:00 1 <NA> 0 0 1 0 \n",
"13533 12 21 2024-11-02 13:44:00-04:00 1 <NA> 1 0 0 0 \n",
"\n",
" location street \\\n",
"id \n",
Expand All @@ -363,11 +363,11 @@
"1661 County 624 W MP 2.2 at Ikea Dr None \n",
"1811 County 648 E MP .87 at Franklin Ave None \n",
"... ... ... \n",
"13524 County 636 None \n",
"13523 State Highway 1 None \n",
"13525 State Highway 22 None \n",
"13531 State/Interstate Authority 1 (Truck (Rt. 1 and... None \n",
"13530 State Highway 46 None \n",
"13533 New Road New Road \n",
"\n",
" highway \n",
"id \n",
Expand All @@ -377,13 +377,13 @@
"1661 624 \n",
"1811 648 \n",
"... ... \n",
"13524 636 \n",
"13523 1 \n",
"13525 22 \n",
"13531 1 \n",
"13530 46 \n",
"13533 None \n",
"\n",
"[9499 rows x 12 columns]"
"[9500 rows x 12 columns]"
]
},
"execution_count": 5,
Expand Down Expand Up @@ -416,7 +416,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Most recent NJSP run date: 2024-11-02 10:00:02-04:00\n",
"Most recent NJSP run date: 2024-11-03 10:00:03-05:00\n",
"Most recent month end: 2024-11-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 @@ -663,12 +663,12 @@
"1661 2008-01\n",
"1811 2008-01\n",
" ... \n",
"13524 2024-10\n",
"13523 2024-10\n",
"13525 2024-10\n",
"13531 2024-10\n",
"13530 2024-10\n",
"Name: ym, Length: 9499, dtype: object"
"13533 2024-11\n",
"Name: ym, Length: 9500, dtype: object"
]
},
"execution_count": 13,
Expand Down Expand Up @@ -828,10 +828,6 @@
" </tr>\n",
" <tr>\n",
" <th rowspan=\"5\" valign=\"top\">2024</th>\n",
" <th>6</th>\n",
" <td>64</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>47</td>\n",
" </tr>\n",
Expand All @@ -847,9 +843,13 @@
" <th>10</th>\n",
" <td>67</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>202 rows \u00d7 1 columns</p>\n",
"<p>203 rows \u00d7 1 columns</p>\n",
"</div>"
],
"text/plain": [
Expand All @@ -861,13 +861,13 @@
" 4 50\n",
" 5 46\n",
"... ..\n",
"2024 6 64\n",
" 7 47\n",
"2024 7 47\n",
" 8 63\n",
" 9 62\n",
" 10 67\n",
" 11 1\n",
"\n",
"[202 rows x 1 columns]"
"[203 rows x 1 columns]"
]
},
"execution_count": 16,
Expand Down Expand Up @@ -1042,12 +1042,12 @@
" 4 50\n",
" 5 46\n",
" ..\n",
"2024 6 64\n",
" 7 47\n",
"2024 7 47\n",
" 8 63\n",
" 9 62\n",
" 10 67\n",
"Name: tk, Length: 202, dtype: Int8"
" 11 1\n",
"Name: tk, Length: 203, dtype: Int8"
]
},
"execution_count": 18,
Expand Down Expand Up @@ -1365,7 +1365,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"675 projected deaths for 2024\n"
"676 projected deaths for 2024\n"
]
}
],
Expand Down Expand Up @@ -1566,11 +1566,11 @@
" </tr>\n",
" <tr>\n",
" <th>2024</th>\n",
" <td>298</td>\n",
" <td>299</td>\n",
" <td>168</td>\n",
" <td>69</td>\n",
" <td>20</td>\n",
" <td>675</td>\n",
" <td>676</td>\n",
" <td>120</td>\n",
" </tr>\n",
" </tbody>\n",
Expand All @@ -1596,7 +1596,7 @@
"2021 368 217 86 26 697 0\n",
"2022 379 191 103 16 689 0\n",
"2023 319 171 89 27 606 0\n",
"2024 298 168 69 20 675 120"
"2024 299 168 69 20 676 120"
]
},
"execution_count": 23,
Expand Down Expand Up @@ -2894,6 +2894,13 @@
" <td>8</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2024-11</th>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
Expand Down Expand Up @@ -2958,7 +2965,8 @@
"2024-07 32 11 1 3\n",
"2024-08 29 20 9 5\n",
"2024-09 37 17 7 1\n",
"2024-10 35 22 8 2"
"2024-10 35 22 8 2\n",
"2024-11 1 0 0 0"
]
},
"execution_count": 36,
Expand Down
Loading

0 comments on commit 4785dff

Please sign in to comment.