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 Jan 12, 2025
1 parent 1021594 commit 5c9c6bd
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 48 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 @@ -356,7 +356,7 @@ year,county,driver,passenger,cyclist,pedestrian,crashes
2024,Sussex,8,2,1,2,13
2024,Union,18,6,1,13,34
2024,Warren,12,1,1,2,15
2025,Camden,1,0,0,0,1
2025,Camden,2,0,0,0,2
2025,Mercer,0,0,0,1,1
2025,Middlesex,1,1,0,0,2
2025,Union,0,0,0,1,1
84 changes: 39 additions & 45 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>13682</th>\n",
" <td>12</td>\n",
" <td>21</td>\n",
" <td>2025-01-01 07:24:00-05: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 130</td>\n",
" <td>None</td>\n",
" <td>130</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13686</th>\n",
" <td>11</td>\n",
" <td>3</td>\n",
Expand Down Expand Up @@ -335,9 +320,24 @@
" <td>None</td>\n",
" <td>629</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13696</th>\n",
" <td>4</td>\n",
" <td>27</td>\n",
" <td>2025-01-11 13:57:00-05: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>90</td>\n",
" <td>None</td>\n",
" <td>90</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>9632 rows \u00d7 12 columns</p>\n",
"<p>9633 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",
"13682 12 21 2025-01-01 07:24:00-05:00 1 <NA> 0 1 0 0 \n",
"13686 11 3 2025-01-02 22:01:00-05:00 1 <NA> 0 0 1 0 \n",
"13694 12 15 2025-01-04 09:56:00-05:00 1 <NA> 1 0 0 0 \n",
"13691 4 16 2025-01-07 06:38:00-05:00 1 <NA> 1 0 0 0 \n",
"13695 20 4 2025-01-09 22:46:00-05:00 1 <NA> 0 0 1 0 \n",
"13696 4 27 2025-01-11 13:57:00-05:00 1 <NA> 1 0 0 0 \n",
"\n",
" location street highway \n",
"id \n",
Expand All @@ -363,13 +363,13 @@
"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",
"13682 State Highway 130 None 130 \n",
"13686 New Jersey Turnpike MP 59.2 None 95 \n",
"13694 Garden State Parkway None 444 \n",
"13691 State Highway 130 None 130 \n",
"13695 County 629 None 629 \n",
"13696 90 None 90 \n",
"\n",
"[9632 rows x 12 columns]"
"[9633 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: 2025-01-11 10:00:03-05:00\n",
"Most recent NJSP run date: 2025-01-12 10:00:05-05:00\n",
"Most recent month end: 2025-01-01 00:00:00-05:00\n",
"Current year start: 2025-01-01 00:00:00-05:00\n",
"Next year start: 2026-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",
"13682 2025-01\n",
"13686 2025-01\n",
"13694 2025-01\n",
"13691 2025-01\n",
"13695 2025-01\n",
"Name: ym, Length: 9632, dtype: object"
"13696 2025-01\n",
"Name: ym, Length: 9633, dtype: object"
]
},
"execution_count": 13,
Expand Down Expand Up @@ -832,7 +832,7 @@
" <tr>\n",
" <th>2025</th>\n",
" <th>1</th>\n",
" <td>5</td>\n",
" <td>6</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
Expand All @@ -852,7 +852,7 @@
" 10 80\n",
" 11 69\n",
" 12 51\n",
"2025 1 5\n",
"2025 1 6\n",
"\n",
"[205 rows x 1 columns]"
]
Expand Down Expand Up @@ -1033,7 +1033,7 @@
" 10 80\n",
" 11 69\n",
" 12 51\n",
"2025 1 5\n",
"2025 1 6\n",
"Name: tk, Length: 205, dtype: Int8"
]
},
Expand Down Expand Up @@ -1353,7 +1353,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"672 projected deaths for 2025\n"
"674 projected deaths for 2025\n"
]
}
],
Expand Down Expand Up @@ -1563,12 +1563,12 @@
" </tr>\n",
" <tr>\n",
" <th>2025</th>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>672</td>\n",
" <td>667</td>\n",
" <td>674</td>\n",
" <td>668</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
Expand All @@ -1594,7 +1594,7 @@
"2022 379 191 103 16 689 0\n",
"2023 319 171 89 27 606 0\n",
"2024 360 222 84 25 691 0\n",
"2025 2 2 1 0 672 667"
"2025 3 2 1 0 674 668"
]
},
"execution_count": 23,
Expand Down Expand Up @@ -1948,11 +1948,11 @@
" <tr>\n",
" <th rowspan=\"4\" valign=\"top\">2025</th>\n",
" <th>Camden</th>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mercer</th>\n",
Expand Down Expand Up @@ -1993,7 +1993,7 @@
" Cape May 5 0 1 3 8\n",
"... ... ... ... ... ...\n",
"2024 Warren 12 1 1 2 15\n",
"2025 Camden 1 0 0 0 1\n",
"2025 Camden 2 0 0 0 2\n",
" Mercer 0 0 0 1 1\n",
" Middlesex 1 1 0 0 2\n",
" Union 0 0 0 1 1\n",
Expand Down Expand Up @@ -2182,11 +2182,11 @@
" <tr>\n",
" <th rowspan=\"4\" valign=\"top\">2025</th>\n",
" <th>Camden</th>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mercer</th>\n",
Expand Down Expand Up @@ -2227,7 +2227,7 @@
" Cape May 8 3 0 0 11\n",
"... ... ... ... ... ...\n",
"2024 Warren 12 1 1 2 15\n",
"2025 Camden 1 0 0 0 1\n",
"2025 Camden 2 0 0 0 2\n",
" Mercer 0 0 0 1 1\n",
" Middlesex 1 1 0 0 2\n",
" Union 0 0 0 1 1\n",
Expand Down Expand Up @@ -2910,7 +2910,7 @@
" </tr>\n",
" <tr>\n",
" <th>2025-01</th>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
Expand Down Expand Up @@ -2982,7 +2982,7 @@
"2024-10 41 26 9 4\n",
"2024-11 31 30 5 3\n",
"2024-12 25 18 8 0\n",
"2025-01 2 2 1 0"
"2025-01 3 2 1 0"
]
},
"execution_count": 36,
Expand Down Expand Up @@ -3276,13 +3276,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Wrote plot JSON to www/public/plots/fatalities_by_month_lines.json\n"
]
},
{
"name": "stderr",
"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",
"Wrote plot image to www/public/plots/fatalities_by_month_lines_titled.png\n"
]
Expand Down
Loading

0 comments on commit 5c9c6bd

Please sign in to comment.