diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-27-output-1.png b/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-27-output-1.png deleted file mode 100644 index 700ed3d..0000000 Binary files a/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-27-output-1.png and /dev/null differ diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-31-output-1.png b/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-31-output-1.png deleted file mode 100644 index eddf93f..0000000 Binary files a/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-31-output-1.png and /dev/null differ diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-34-output-1.png b/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-34-output-1.png deleted file mode 100644 index 9fc98d2..0000000 Binary files a/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-34-output-1.png and /dev/null differ diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-38-output-1.png b/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-38-output-1.png deleted file mode 100644 index 45b418a..0000000 Binary files a/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-38-output-1.png and /dev/null differ diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-41-output-1.png b/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-41-output-1.png deleted file mode 100644 index 791f0df..0000000 Binary files a/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-41-output-1.png and /dev/null differ diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-44-output-1.png b/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-44-output-1.png deleted file mode 100644 index a255439..0000000 Binary files a/0 - Auto Operating Cost - 2022-01-11_files/figure-html/cell-44-output-1.png and /dev/null differ diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-24-output-1.svg b/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-24-output-1.svg deleted file mode 100644 index dd2a7c7..0000000 --- a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-24-output-1.svg +++ /dev/null @@ -1,2403 +0,0 @@ - - - - - - - - 2025-10-02T11:22:55.108512 - image/svg+xml - - - Matplotlib v3.10.6, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-27-output-1.svg b/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-27-output-1.svg deleted file mode 100644 index 1904227..0000000 --- a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-27-output-1.svg +++ /dev/null @@ -1,2472 +0,0 @@ - - - - - - - - 2025-10-02T11:22:55.279887 - image/svg+xml - - - Matplotlib v3.10.6, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-28-output-1.svg b/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-28-output-1.svg deleted file mode 100644 index 6ebf3fa..0000000 --- a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-28-output-1.svg +++ /dev/null @@ -1,2118 +0,0 @@ - - - - - - - - 2025-10-02T11:22:55.405545 - image/svg+xml - - - Matplotlib v3.10.6, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-31-output-1.svg b/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-31-output-1.svg deleted file mode 100644 index d84eac6..0000000 --- a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-31-output-1.svg +++ /dev/null @@ -1,2182 +0,0 @@ - - - - - - - - 2025-10-02T11:22:55.573208 - image/svg+xml - - - Matplotlib v3.10.6, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-34-output-1.svg b/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-34-output-1.svg deleted file mode 100644 index 3ea76ce..0000000 --- a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-34-output-1.svg +++ /dev/null @@ -1,2271 +0,0 @@ - - - - - - - - 2025-10-02T11:22:55.739474 - image/svg+xml - - - Matplotlib v3.10.6, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-35-output-1.svg b/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-35-output-1.svg deleted file mode 100644 index 5dc8cbd..0000000 --- a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-35-output-1.svg +++ /dev/null @@ -1,2158 +0,0 @@ - - - - - - - - 2025-10-02T11:22:55.881648 - image/svg+xml - - - Matplotlib v3.10.6, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-38-output-1.svg b/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-38-output-1.svg deleted file mode 100644 index bca3fc9..0000000 --- a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-38-output-1.svg +++ /dev/null @@ -1,2673 +0,0 @@ - - - - - - - - 2025-10-02T11:22:56.047402 - image/svg+xml - - - Matplotlib v3.10.6, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-41-output-1.svg b/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-41-output-1.svg deleted file mode 100644 index faf24b3..0000000 --- a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-41-output-1.svg +++ /dev/null @@ -1,2911 +0,0 @@ - - - - - - - - 2025-10-02T11:22:56.193344 - image/svg+xml - - - Matplotlib v3.10.6, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-42-output-1.svg b/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-42-output-1.svg deleted file mode 100644 index 5e4ca22..0000000 --- a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-42-output-1.svg +++ /dev/null @@ -1,2526 +0,0 @@ - - - - - - - - 2025-10-02T11:22:56.315517 - image/svg+xml - - - Matplotlib v3.10.6, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-43-output-1.svg b/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-43-output-1.svg deleted file mode 100644 index 063835a..0000000 --- a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-43-output-1.svg +++ /dev/null @@ -1,2924 +0,0 @@ - - - - - - - - 2025-10-02T11:22:56.428444 - image/svg+xml - - - Matplotlib v3.10.6, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-44-output-1.svg b/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-44-output-1.svg deleted file mode 100644 index 7904c27..0000000 --- a/0 - Auto Operating Cost - 2022-01-11_files/figure-typst/cell-44-output-1.svg +++ /dev/null @@ -1,2555 +0,0 @@ - - - - - - - - 2025-10-02T11:22:56.553626 - image/svg+xml - - - Matplotlib v3.10.6, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/bls/SeriesReport-20250417132056_f4c921.xlsx b/data/bls/SeriesReport-20250417132056_f4c921.xlsx deleted file mode 100644 index e7f9a54..0000000 Binary files a/data/bls/SeriesReport-20250417132056_f4c921.xlsx and /dev/null differ diff --git a/data/bls/cpi_1913_present.xlsx b/data/bls/cpi_1913_present.xlsx new file mode 100644 index 0000000..e75d5ea Binary files /dev/null and b/data/bls/cpi_1913_present.xlsx differ diff --git a/data/bts/table_04_23_042425.xlsx b/data/bts/table_04_23_042425.xlsx new file mode 100644 index 0000000..71659eb Binary files /dev/null and b/data/bts/table_04_23_042425.xlsx differ diff --git a/data/doe/TEDB_Ed_40.pdf b/data/doe/TEDB_Ed_40.pdf new file mode 100644 index 0000000..7a0a87e Binary files /dev/null and b/data/doe/TEDB_Ed_40.pdf differ diff --git a/data/eia/PET_PRI_GND_A_EPD2D_PTE_DPGAL_W.xls b/data/eia/PET_PRI_GND_A_EPD2D_PTE_DPGAL_W.xls index 7c4f566..bb54f0b 100644 Binary files a/data/eia/PET_PRI_GND_A_EPD2D_PTE_DPGAL_W.xls and b/data/eia/PET_PRI_GND_A_EPD2D_PTE_DPGAL_W.xls differ diff --git a/data/eia/PET_PRI_GND_A_EPM0_PTE_DPGAL_W.xls b/data/eia/PET_PRI_GND_A_EPM0_PTE_DPGAL_W.xls index 8a6001b..cf1b1cc 100644 Binary files a/data/eia/PET_PRI_GND_A_EPM0_PTE_DPGAL_W.xls and b/data/eia/PET_PRI_GND_A_EPM0_PTE_DPGAL_W.xls differ diff --git a/0 - Auto Operating Cost - 2022-01-11.html b/index.html similarity index 57% rename from 0 - Auto Operating Cost - 2022-01-11.html rename to index.html index c1a4fb9..68b92d6 100644 --- a/0 - Auto Operating Cost - 2022-01-11.html +++ b/index.html @@ -2,7 +2,7 @@ - + @@ -60,18 +60,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -81,13 +81,55 @@ -
+
+
+
+

Auto Operating Costs Calculation

+

Estimating Auto Operating Costs for Travel Demand Model

+
+
+ +
+
Author
+
Affiliation
+ +
+

Pukar Bhandari

+
+ +
+ +
+ + +
+
Published
+
+

September 17, 2025

+
+
+ + +
+ + +
-
- -
-
-

Auto Operating Costs Calculation

-

Estimating Auto Operating Costs for Travel Demand Model

-
- - -
-
Author
-
Affiliation
- -
-

Pukar Bhandari

-
- -
+
-
- - -
-
Published
-
-

September 17, 2025

-
-
- - -
- -
-

This document is just replicating the excel sheet located in /archive-v9.0/1 - Auto Operating Costs - 2022-01-11.xlsx.

-
-

1 Import Libraries

-
!pip install pandas openpyxl
+

This document updates the 0 - Auto Operating Cost - 2022-01-11.qmd to the new base year 2023.

+
+

1 Environment Setup

+
+

Load Libraries

+
!pip install numpy pandas geopandas matplotlib seaborn scipy openpyxl xlrd datetime python-dotenv pdfplumber
 # OR
-!conda install pandas openpyxl
-
+!conda install numpy pandas geopandas matplotlib seaborn scipy openpyxl xlrd datetime python-dotenv pdfplumber
+
+
+Show the code
# For Analysis
 import numpy as np
 import pandas as pd
@@ -185,29 +194,54 @@ 

from scipy.interpolate import make_interp_spline from scipy import stats -# For Date time processing -import datetime

+# misc +import datetime +import os +from pathlib import Path +import requests +import pdfplumber +import re
+ +
+ +
+

Set Base Year for Calculations

+
+
+Show the code +
BASE_YEAR = 2023
+
+

2 Read Raw Data

3-11

Table 3-11: Sales Price of Transportation Fuel to End-Users [Source: Bureau of Transportation Statistics]

-

File URL: https://www.bts.gov/sites/bts.dot.gov/files/2024-03/table_03_11_032824.xlsx

-
-
# Read Excel file directly from URL
-df_3_11 = pd.read_excel(
-  "archive-v9.0\\Support Data\\BTS - National - Auto Cost & Gas Price.xlsx",
-  sheet_name="3-11",
-  header=1,
-  usecols="A:AH", # TODO: update cols later for new data
-  nrows=10
-)
-
-# display the data
-df_3_11
-
+
+
+Show the code +
# Ensure file exists
+filepath_3_11 = Path("data/bts/table_03_11_032824.xlsx")
+if not filepath_3_11.exists():
+    filepath_3_11.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://www.bts.gov/sites/bts.dot.gov/files/2024-03/table_03_11_032824.xlsx")
+    filepath_3_11.write_bytes(response.content)
+
+# Read Excel file
+df_3_11 = pd.read_excel(
+  filepath_3_11,
+  sheet_name="3-11",
+  header=1,
+  usecols="A:AK", # TODO: update cols later for new data
+  nrows=10
+)
+
+# display the data
+df_3_11
+
+
@@ -226,9 +260,6 @@

3-11

1995 1996 ... -2011 -2012 -2013 2014 2015 2016 @@ -236,6 +267,9 @@

3-11

2018 2019 2020 +2021 +2022c +2023 @@ -276,16 +310,16 @@

3-11

100.50 111.60 ... -380.30 -397.1 -393.20 398.6 W W W W W -263.9 +268.50 +346.9 +413.5 +U 2 @@ -300,16 +334,16 @@

3-11

54.00 65.10 ... -305.40 -310.4 -297.90 277.2 162.9 131.9 162.9 211.9 197 -121.8 +129.30 +195.4 +281.0 +U 3 @@ -348,16 +382,16 @@

3-11

133.60 141.30 ... -379.20 -392.2 -384.30 371.3 286.6 261 291.1 327 321.2 -279.1 +279.10 +369.2 +486.3 +446.9 5 @@ -372,16 +406,16 @@

3-11

114.70 123.10 ... -352.70 -364.4 -352.60 336.7 244.8 214.2 240.8 273.5 263.6 -217.4 +217.40 +305.1 +409.4 +365.8 6 @@ -396,16 +430,16 @@

3-11

120.50 128.80 ... -357.70 -369.5 -358.40 342.5 251.0 220.4 246.9 279.4 269.8 -224.2 +224.20 +313.3 +419.2 +377.1 7 @@ -420,16 +454,16 @@

3-11

56.00 68.10 ... -311.70 -320.2 -312.20 292.3 181.9 151.1 181.1 225.6 211.4 -147.7 +148.60 +220.3 +307.9 +U 8 @@ -468,21 +502,21 @@

3-11

60.01 67.66 ... -307.07 -316.7 -312.37 294.7 179.14 143.97 177.08 223 205.07 +142.34 +214.0 +362.0 U -

10 rows × 34 columns

+

10 rows × 37 columns

@@ -490,20 +524,29 @@

3-11

3-12

Table 3-12: Price Trends of Gasoline v. Other Consumer Goods and Services [Source: Bureau of Transportation Statistics]

-

File URL: https://www.bts.gov/sites/bts.dot.gov/files/2024-03/table_03_12_032824_1.xlsx

-
-
# Read Excel file directly from URL
-df_3_12 = pd.read_excel(
-  "archive-v9.0\\Support Data\\BTS - National - Auto Cost & Gas Price.xlsx",
-  sheet_name="3-12",
-  header=1,
-  usecols="A:AJ", # TODO: update cols later for new data
-  nrows=15
-)
-
-# display the data
-df_3_12
-
+
+
+Show the code +
# Ensure file exists
+filepath_3_12 = Path("data/bts/table_03_12_032824_1.xlsx")
+if not filepath_3_12.exists():
+    filepath_3_12.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://www.bts.gov/sites/bts.dot.gov/files/2024-03/table_03_12_032824_1.xlsx")
+    filepath_3_12.write_bytes(response.content)
+
+# Read Excel file
+df_3_12 = pd.read_excel(
+  filepath_3_12,
+  sheet_name="3-12",
+  header=1,
+  usecols="A:AM", # TODO: update cols later for new data
+  nrows=15
+)
+
+# display the data
+df_3_12
+
+
@@ -522,9 +565,6 @@

3-12

1993 1994 ... -2011 -2012 -2013 2014 2015 2016 @@ -532,6 +572,9 @@

3-12

2018 2019 2020 +2021 +2022 +2023 @@ -564,47 +607,47 @@

3-12

Total service station price 1.922553 2.196066 -2.926173 -2.198561 -1.873159 -1.776215 -1.724424 -1.657985 -1.625456 -... -3.296684 -3.334806 -3.187406 -2.995277 -2.191304 -1.899656 -2.083261 -2.301386 -2.182764 -1.791483 +2.921370 +2.196278 +1.872924 +1.775896 +1.724054 +1.657571 +1.625004 +... +2.995521 +2.191476 +1.899763 +2.083883 +2.301965 +2.183241 +1.790421 +2.386637 +2.954316 +U 2 Service station price excluding taxes 1.327628 1.718324 -2.578960 -1.829438 -1.514689 -1.356071 -1.295927 -1.149847 -1.121620 -... -2.930058 -2.973528 -2.829018 -2.637042 -1.812043 -1.525051 -1.695129 -1.931261 -1.808475 +2.574157 +1.827538 +1.437550 +1.355829 +1.295649 +1.149560 +1.121308 +... +2.637256 +1.812185 +1.525137 +1.695634 +1.931748 +1.808869 +1.419184 +2.034933 +2.755224 U @@ -613,22 +656,22 @@

3-12

0.594925 0.477742 0.347213 -0.369123 -0.358471 -0.420143 -0.428498 -0.508138 -0.503836 -... -0.366626 -0.361278 -0.358387 -0.358235 -0.379261 -0.374605 -0.388133 -0.370124 -0.374290 +0.368740 +0.435374 +0.420068 +0.428406 +0.508011 +0.503696 +... +0.358264 +0.379291 +0.374626 +0.388249 +0.370218 +0.374372 +0.371237 +0.351703 +0.199092 U @@ -668,16 +711,16 @@

3-12

1.173000 1.174000 ... -3.577000 -3.695000 -3.584000 3.425000 2.510000 2.204000 2.469000 2.794000 2.698000 -2.242 +2.242000 +3.133000 +4.192000 +3.771 6 @@ -686,22 +729,22 @@

3-12

0.446000 1.083000 0.995200 -0.984100 +0.934100 0.913100 0.894300 0.813500 0.810100 ... -3.179200 -3.294700 -3.181020 3.015370 2.075580 1.769380 2.009000 2.344650 2.235360 -2.058 +1.777130 +2.671310 +3.909500 +U 7 @@ -710,22 +753,22 @@

3-12

0.124000 0.138000 0.200800 -0.232900 +0.282900 0.282900 0.295700 0.359500 0.363900 ... -0.397800 -0.400300 -0.402980 0.409630 0.434420 0.434620 0.460000 0.449350 0.462640 -0.184 +0.464870 +0.461690 +0.282500 +U 8 @@ -764,16 +807,16 @@

3-12

144.500000 148.200000 ... -224.939000 -229.594000 -232.957000 236.736000 237.017000 240.007000 245.120000 251.107000 255.657000 -258.811 +258.811000 +270.970000 +292.655000 +304.702 10 @@ -788,16 +831,16 @@

3-12

140.900000 144.300000 ... -227.842000 -233.777000 -237.037000 242.725000 247.235000 247.931000 250.065000 253.558000 258.316000 -267.219 +267.219000 +277.756000 +305.388000 +322.965 11 @@ -812,16 +855,16 @@

3-12

155.700000 160.500000 ... -251.646000 -257.083000 -263.056000 270.513000 278.803000 288.230000 297.803000 307.663000 318.053000 -325.886 +325.886000 +334.575000 +354.235000 +380.643 12 @@ -836,16 +879,16 @@

3-12

133.700000 133.400000 ... -122.111000 -126.265000 -127.411000 127.514000 125.903000 126.045000 125.612000 125.654000 124.052000 -118.079 +118.079000 +120.993000 +127.081000 +130.579 13 @@ -860,16 +903,16 @@

3-12

98.000000 98.500000 ... -302.619000 -312.660000 -303.850000 292.435000 213.062000 188.389000 212.721000 241.861000 233.234000 -195.242 +195.242000 +265.083000 +350.261000 +313.257 14 @@ -884,21 +927,21 @@

3-12

201.400000 211.000000 ... -400.258000 -414.924000 -425.134000 435.292000 446.752000 463.675000 475.322000 484.707000 498.413000 -518.876 +518.876000 +525.276000 +546.554000 +549.084 -

15 rows × 36 columns

+

15 rows × 39 columns

@@ -906,20 +949,29 @@

3-12

3-25

Table 3-25: Average Wage and Salary Accruals per Full-Time Equivalent Employee by Transportation Industry [Source: Bureau of Transportation Statistics]

-

File URL: https://www.bts.gov/sites/bts.dot.gov/files/2022-10/table_03_25_102122.xlsx

-
-
# Read Excel file directly from URL
-df_3_25 = pd.read_excel(
-  "archive-v9.0\\Support Data\\BTS - National - Income-Wage.xlsx",
-  sheet_name="3-25",
-  header=1,
-  usecols="A:X", # TODO: update cols later for new data
-  nrows=10
-)
-
-# display the data
-df_3_25
-
+
+
+Show the code +
# Ensure file exists
+filepath_3_25 = Path("data/bts/table_03_25_102122.xlsx")
+if not filepath_3_25.exists():
+    filepath_3_25.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://www.bts.gov/sites/bts.dot.gov/files/2022-10/table_03_25_102122.xlsx")
+    filepath_3_25.write_bytes(response.content)
+
+# Read Excel file
+df_3_25 = pd.read_excel(
+  filepath_3_25,
+  sheet_name="3-25",
+  header=1,
+  usecols="A:Y", # TODO: update cols later for new data
+  nrows=10
+)
+
+# display the data
+df_3_25
+
+
@@ -938,16 +990,16 @@

3-25

2005 2006 ... -2011 2012 2013 2014 2015 2016 -2017 -2018 -2019 -2020 +(R) 2017 +(R) 2018 +(R) 2019 +(R) 2020 +2021 @@ -964,16 +1016,16 @@

3-25

45643 47731 ... -54699 56089 56667 58350 59993 60826 -62721 -64685 -66781 -71456 +62726 +64694 +66712 +71455 +75447 1 @@ -988,16 +1040,16 @@

3-25

43939 45491 ... -51305 52427 53364 54817 55941 56593 -57905 -59652 -60647 -61666 +57808 +59628 +60654 +61448 +64575 2 @@ -1012,16 +1064,16 @@

3-25

56772 59290 ... -69400 70419 77843 80317 84815 92313 -94909 -96781 -98449 -99954 +94766 +96598 +98315 +99822 +102091 3 @@ -1036,16 +1088,16 @@

3-25

72903 75207 ... -86303 92289 88364 94268 95455 93446 96818 -103016 -103306 -114672 +103022 +103288 +102729 +109009 4 @@ -1060,7 +1112,6 @@

3-25

62903 66463 ... -82480 82976 84329 87942 @@ -1068,8 +1119,9 @@

3-25

89909 92209 95416 -96468 -101096 +96452 +101142 +103624 5 @@ -1084,16 +1136,16 @@

3-25

41481 43069 ... -46869 47810 48831 50679 52057 52676 -54525 -57211 -58338 -60585 +54527 +57218 +58314 +60735 +65173 6 @@ -1108,16 +1160,16 @@

3-25

27123 28600 ... -32015 32553 33125 34236 35413 37442 -40547 -44520 -51674 -49588 +39639 +44447 +52013 +50792 +55611 7 @@ -1132,7 +1184,6 @@

3-25

88952 97746 ... -119021 137264 124309 124963 @@ -1140,8 +1191,9 @@

3-25

130880 136721 137285 -146037 -145784 +146016 +145967 +146251 8 @@ -1156,16 +1208,16 @@

3-25

42518 44126 ... -49988 50800 51636 52364 52882 53007 -53984 -55216 -55694 -57562 +53986 +55214 +55684 +57591 +62295 9 @@ -1180,21 +1232,21 @@

3-25

38861 39410 ... -44956 45408 45603 46375 46642 45893 -45659 -46457 -46818 -48340 +45661 +46446 +46814 +48290 +50708 -

10 rows × 24 columns

+

10 rows × 25 columns

@@ -1202,20 +1254,29 @@

3-25

4-12

Table 4-12: Light Duty Vehicle, Long Wheel Base Fuel Consumption and Travel [Source: Bureau of Transportation Statistics]

-

File URL: https://www.bts.gov/sites/bts.dot.gov/files/2025-03/table_04_12M_032725.xlsx

-
-
# Read Excel file directly from URL
-df_4_12 = pd.read_excel(
-  "archive-v9.0\\Support Data\\BTS - National - Fuel Efficiency.xlsx",
-  sheet_name="4-12",
-  header=1,
-  usecols="A:AI", # TODO: update cols later for new data
-  nrows=6
-)
-
-# display the data
-df_4_12
-
+
+
+Show the code +
# Ensure file exists
+filepath_4_12 = Path("data/bts/table_04_12M_032725.xlsx")
+if not filepath_4_12.exists():
+    filepath_4_12.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://www.bts.gov/sites/bts.dot.gov/files/2025-03/table_04_12M_032725.xlsx")
+    filepath_4_12.write_bytes(response.content)
+
+# Read Excel file
+df_4_12 = pd.read_excel(
+  filepath_4_12,
+  sheet_name="4-12M",
+  header=1,
+  usecols="A:AM", # TODO: update cols later for new data
+  nrows=6
+)
+
+# display the data
+df_4_12
+
+
@@ -1234,16 +1295,16 @@

4-12

1993 1994 ... -2010 -2011 -2012 -2013 2014 2015 2016 2017 2018 2019 +2020 +2021 +2022 +2023 @@ -1255,166 +1316,176 @@

4-12

27875.934000 37213.862554 48274.555010 -53033.443000 -57091.142829 -59993.705543 -57141.967000 -... -40241.657961 -50318.787311 -50588.676217 -51512.739867 -52600.309315 -53298.884000 -54870.473000 -56880.878000 -57853.642000 -59465.369000 +5.303344e+04 +5.709114e+04 +5.999371e+04 +6.290359e+04 +... +5.260031e+04 +5.329888e+04 +5.487047e+04 +5.688088e+04 +5.785364e+04 +5.946537e+04 +5.879628e+04 +6.053074e+04 +6.146497e+04 +6.210400e+04 1 -Vehicle-miles traveled (millions) -123286.000000 -200700.000000 -290935.000000 -390960.594244 -574570.645532 -649393.980496 -706862.759067 -745749.875553 -669321.074506 -... -622711.753397 -604175.473333 -601231.899220 -603306.816472 -638484.173908 -631852.444733 -657954.081275 -656577.526707 -664495.031255 -669744.315204 +Vehicle-kilometers traveled (millions) +198409.584384 +322995.340800 +468214.496640 +629190.086582 +924681.820963 +1.045098e+06 +1.137585e+06 +1.200168e+06 +1.230559e+06 +... +1.027541e+06 +1.016868e+06 +1.058874e+06 +1.056659e+06 +1.069401e+06 +1.077849e+06 +1.027157e+06 +1.102564e+06 +1.102173e+06 +1.135426e+06 2 -Fuel consumed (million gallons) -12313.439000 -19080.677699 -23796.196146 -27363.169914 -35611.040835 -38216.904843 -40929.421682 -42851.206705 -44422.988268 -... -36250.973903 -35334.618042 -35114.343892 -35158.688623 -37342.987266 -36437.330269 -37818.755208 -37466.749228 -37189.349730 -38028.860029 +Fuel consumed (million liters) +46611.439752 +72228.226329 +90078.406447 +103580.871750 +134802.461308 +1.446667e+05 +1.549347e+05 +1.622095e+05 +1.669836e+05 +... +1.413586e+05 +1.379303e+05 +1.431596e+05 +1.418271e+05 +1.407770e+05 +1.439583e+05 +1.341489e+05 +1.457155e+05 +1.436150e+05 +1.488981e+05 3 -Average miles traveled per vehicle (thousands) -8.675642 -9.829442 -10.436780 -10.505778 -11.902143 -12.244990 -12.381303 -12.430469 -11.713301 -... -15.474307 -12.006956 -11.884713 -11.711798 -12.138411 -11.854891 -11.991041 -11.543027 -11.485794 -11.262762 +Average kilometers traveled per vehicle (thous... +13.962092 +15.818953 +16.796370 +16.907411 +19.154642 +1.970640e+01 +1.992578e+01 +2.000490e+01 +1.956261e+01 +... +1.953488e+01 +1.907860e+01 +1.929771e+01 +1.857670e+01 +1.848459e+01 +1.812566e+01 +1.746976e+01 +1.821494e+01 +1.793173e+01 +1.828266e+01 4 -Average miles traveled per gallon -10.012313 -10.518494 -12.226114 -14.287840 -16.134621 -16.992323 -17.270285 -17.403241 -15.066998 -... -17.177794 -17.098684 -17.122117 -17.159537 -17.097833 -17.340800 -17.397560 -17.524273 -17.867885 -17.611475 +Average kilometers traveled per liter +4.256671 +4.471871 +5.197855 +6.074385 +6.859532 +7.224179e+00 +7.342352e+00 +7.398878e+00 +7.369338e+00 +... +7.269036e+00 +7.372331e+00 +7.396463e+00 +7.450334e+00 +7.596419e+00 +7.487233e+00 +7.656845e+00 +7.566549e+00 +7.674499e+00 +7.625522e+00 5 -Average fuel consumed per vehicle (gallons) -866.497319 -934.491335 -853.646595 -735.295077 -737.677247 -720.618966 -716.913687 -714.261710 -777.414405 -... -900.832017 -702.215215 -694.114702 -682.524143 -709.938549 -683.641524 -689.236909 -658.687955 -642.817780 -639.512723 +Average fuel consumed per vehicle (liters) +3280.049349 +3537.434713 +3231.404065 +2783.394806 +2792.412303 +2.727840e+03 +2.713814e+03 +2.703775e+03 +2.654596e+03 +... +2.687410e+03 +2.587865e+03 +2.609046e+03 +2.493405e+03 +2.433330e+03 +2.420876e+03 +2.281588e+03 +2.407298e+03 +2.336534e+03 +2.397561e+03 -

6 rows × 35 columns

+

6 rows × 39 columns

Fuel Economy - CombinedVehType

-

Table 4-9: Motor Vehicle Fuel Consumption and Travel [Source: Bureau of Transportation Statistics]

-
-
# Read Excel file directly from URL
-df_FE_CombinedVehType = pd.read_excel(
-  "archive-v9.0\\Support Data\\BTS - National - Fuel Efficiency.xlsx",
-  sheet_name="CombinedVehType",
-  header=1,
-  usecols="A:AK", # TODO: update cols later for new data
-  nrows=6
-)
-
-# display the data
-df_FE_CombinedVehType
-
+

Table 4-9: Motor Vehicle Fuel Consumption and Travel [Source: Bureau of Transportation Statistics]

+
+
+Show the code +
# Ensure file exists
+filepath_4_9 = Path("data/bts/table_04_09_032825.xlsx")
+if not filepath_4_9.exists():
+    filepath_4_9.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://www.bts.gov/sites/bts.dot.gov/files/2025-03/table_04_09_032825.xlsx")
+    filepath_4_9.write_bytes(response.content)
+
+# Read Excel file
+df_FE_CombinedVehType = pd.read_excel(
+  filepath_4_9,
+  sheet_name="4-9",
+  header=1,
+  usecols="A:AO", # TODO: update cols later for new data
+  nrows=6
+)
+
+# display the data
+df_FE_CombinedVehType
+
+
@@ -1433,16 +1504,16 @@

Fuel Econom 1991 1992 ... -2010 -2011 -2012 -2013 2014 2015 2016 2017 2018 2019 +2020 +2021 +2022 +2023 @@ -1459,16 +1530,16 @@

Fuel Econom 1.923138e+05 1.944273e+05 ... -2.500700e+05 -2.532157e+05 -2.536394e+05 -2.558768e+05 2.603509e+05 2.636102e+05 2.687991e+05 2.724809e+05 2.736021e+05 2.764912e+05 +2.759364e+05 +2.822146e+05 +2.834010e+05 +2.846143e+05 1 @@ -1483,16 +1554,16 @@

Fuel Econom 2.172050e+06 2.247151e+06 ... -2.967266e+06 -2.950402e+06 -2.969433e+06 -2.988280e+06 3.025656e+06 3.095373e+06 3.174408e+06 3.212347e+06 3.240327e+06 3.261772e+06 +2.903622e+06 +3.132411e+06 +3.196191e+06 +3.246817e+06 2 @@ -1507,16 +1578,16 @@

Fuel Econom 1.285630e+05 1.328876e+05 ... -1.704106e+05 -1.684523e+05 -1.686205e+05 -1.696510e+05 1.733471e+05 1.728810e+05 1.768913e+05 1.779511e+05 1.781303e+05 -1.799910e+05 +1.799981e+05 +1.591845e+05 +1.741307e+05 +1.724165e+05 +1.767953e+05 3 @@ -1531,16 +1602,16 @@

Fuel Econom 1.129430e+01 1.155779e+01 ... -1.186574e+01 -1.165173e+01 -1.170730e+01 -1.167859e+01 1.162145e+01 1.174223e+01 1.180959e+01 1.178926e+01 1.184321e+01 1.179702e+01 +1.052279e+01 +1.109940e+01 +1.127798e+01 +1.140778e+01 4 @@ -1555,16 +1626,16 @@

Fuel Econom 1.689483e+01 1.691017e+01 ... -1.741245e+01 -1.751476e+01 -1.761015e+01 -1.761428e+01 1.745432e+01 1.790465e+01 1.794553e+01 1.805186e+01 1.819076e+01 -1.812186e+01 +1.812114e+01 +1.824061e+01 +1.798885e+01 +1.853762e+01 +1.836484e+01 5 @@ -1579,41 +1650,54 @@

Fuel Econom 6.685064e+02 6.834818e+02 ... -6.814513e+02 -6.652522e+02 -6.648042e+02 -6.630181e+02 6.658211e+02 6.558204e+02 6.580799e+02 6.530773e+02 6.510562e+02 -6.509826e+02 +6.510086e+02 +5.768884e+02 +6.170152e+02 +6.083834e+02 +6.211751e+02 -

6 rows × 37 columns

+

6 rows × 41 columns

Fuel Economy - LightDuty

-

Table 4-23: Average Fuel Efficiency of U.S. Light Duty Vehicles [Source: Bureau of Transportation Statistics]

-
-
# Read Excel file directly from URL
-df_FE_LightDuty = pd.read_excel(
-  "archive-v9.0\\Support Data\\BTS - National - Fuel Efficiency.xlsx",
-  sheet_name="LightDuty",
-  header=1,
-  usecols="A:AG", # TODO: update cols later for new data
-  nrows=12
-)
-
-# display the data
-df_FE_LightDuty
-
+

Table 4-23: Average Fuel Efficiency of U.S. Light Duty Vehicles [Source: Bureau of Transportation Statistics]

+
+
+Show the code +
# Ensure file exists
+filepath_4_23 = Path("data/bts/table_04_23_042425.xlsx")
+if not filepath_4_23.exists():
+    filepath_4_23.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get(
+        "https://www.bts.gov/sites/bts.dot.gov/files/2025-04/table_04_23_042425.xlsx",
+        headers={"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36'}
+    )
+    filepath_4_23.write_bytes(response.content)
+
+# Read Excel file
+df_FE_LightDuty = pd.read_excel(
+  filepath_4_23,
+  sheet_name="4-23",
+  header=1,
+  usecols="A:AK", # TODO: update cols later for new data
+  nrows=12
+)
+
+# display the data
+df_FE_LightDuty
+
+
@@ -1632,16 +1716,16 @@

Fuel Economy - Li 1995 1996 ... -2010 -2011 -2012 -2013 2014 2015 2016 2017 2018 2019 +2020 +2021 +2022 +2023 @@ -1658,16 +1742,16 @@

Fuel Economy - Li 19.602243 19.691458 ... -21.525254 -21.367594 -21.550948 -21.634777 21.402991 21.979313 22.038465 22.274363 22.497301 -22.244734 +22.243634 +22.980009 +22.366546 +22.767227 +22.584552 1 @@ -1682,16 +1766,16 @@

Fuel Economy - Li 21.128875 21.319621 ... -23.341159 -23.079824 -23.303850 -23.410444 23.203282 23.856606 23.956898 24.214896 24.377132 -24.130806 +24.129357 +25.281499 +24.428229 +24.846588 +24.658813 2 @@ -1706,16 +1790,16 @@

Fuel Economy - Li 17.323486 17.311470 ... -17.177794 -17.076254 -17.128316 -17.159537 17.097833 17.340800 17.397560 17.524273 17.867885 -17.611475 +17.611064 +18.010017 +17.797627 +18.051541 +17.936341 3 @@ -1778,14 +1862,14 @@

Fuel Economy - Li 28.600000 28.500000 ... -33.937919 -33.126479 -35.270757 -36.399878 -36.537293 -37.243193 -37.657829 -39.441726 +36.537392 +37.243195 +37.658306 +39.445839 +40.775846 +40.796910 +42.286674 +U U U @@ -1802,14 +1886,14 @@

Fuel Economy - Li 27.700000 28.100000 ... -33.100000 -32.700000 -34.800000 -36.100000 36.300000 37.200000 37.300000 -39.200000 +39.300000 +41.900000 +41.200000 +43.400000 +U U U @@ -1826,14 +1910,14 @@

Fuel Economy - Li 30.300000 29.600000 ... -35.200000 -33.700000 -36.000000 -36.800000 36.900000 37.300000 38.100000 -39.700000 +39.600000 +39.800000 +40.400000 +41.200000 +U U U @@ -1850,14 +1934,14 @@

Fuel Economy - Li 20.500000 20.800000 ... -25.200000 -24.700000 -25.000000 -25.700000 26.500000 27.300000 27.400000 -28.600000 +28.700000 +29.500000 +29.600000 +30.400000 +U U U @@ -1898,14 +1982,14 @@

Fuel Economy - Li 27.500000 27.500000 ... -27.500000 -30.170592 -32.974608 -33.499878 -34.237293 -35.459155 -36.902557 -39.031797 +34.237392 +35.459170 +36.903095 +38.986130 +40.228249 +41.703090 +43.307269 +U U U @@ -1922,41 +2006,57 @@

Fuel Economy - Li 20.600000 20.700000 ... -23.400000 -24.300000 -25.300000 -25.900000 26.300000 27.600000 28.800000 29.400000 +30.000000 +30.400000 +31.000000 +U U U -

12 rows × 33 columns

+

12 rows × 37 columns

Personal Expenditure

-

Table 3-15: Personal Expenditures by Category (Millions of current dollars) [Source: Bureau of Transportation Statistics]

-
-
# Read Excel file directly from URL
-df_PersonalExpenditure = pd.read_excel(
-  "archive-v9.0\\Support Data\\BTS - National - Auto Cost & Gas Price.xlsx",
-  sheet_name="3-15",
-  header=1,
-  usecols="A:AL", # TODO: update cols later for new data
-  nrows=17
-)
-
-# display the data
-df_PersonalExpenditure
-
+

Table 3-15: Personal Expenditures by Category (Millions of current dollars) [Source: Bureau of Transportation Statistics]

+
+
+Show the code +
# Ensure file exists
+filepath_3_15 = Path("data/bts/table_03_15_022525.xlsx")
+if not filepath_3_15.exists():
+    filepath_3_15.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://www.bts.gov/sites/bts.dot.gov/files/2025-02/table_03_15_022525.xlsx")
+    filepath_3_15.write_bytes(response.content)
+
+# Read Excel file
+df_PersonalExpenditure = pd.read_excel(
+  filepath_3_15,
+  sheet_name="3-15",
+  header=1,
+  usecols="A:AP", # TODO: update cols later for new data
+  nrows=17
+)
+
+# Extract years from column names, handling formats like "(R) 2019"
+df_PersonalExpenditure.columns = [
+    str(int(match.group())) if (match := re.search(r'\b(19|20)\d{2}\b', str(col))) else col
+    for col in df_PersonalExpenditure.columns
+]
+
+# display the data
+df_PersonalExpenditure
+
+
@@ -1975,16 +2075,16 @@

Personal Expenditure< 1991 1992 ... -2011 -2012 -2013 -2014 2015 2016 2017 2018 2019 2020 +2021 +2022 +2023 +2024 @@ -2001,16 +2101,16 @@

Personal Expenditure< 3.943449e+06 4.197559e+06 ... -1.069886e+07 -1.104736e+07 -1.136353e+07 -1.184772e+07 -1.226348e+07 -1.269327e+07 -1.323911e+07 -1.391353e+07 -1.442868e+07 -1.404756e+07 +1.229744e+07 +1.272685e+07 +1.329063e+07 +1.393444e+07 +1.443754e+07 +1.422566e+07 +1.611394e+07 +1.769084e+07 +1.882277e+07 +1.982608e+07 1 @@ -2025,16 +2125,16 @@

Personal Expenditure< 4.182740e+05 4.512850e+05 ... -1.080327e+06 -1.135467e+06 -1.170466e+06 -1.202035e+06 -1.163708e+06 -1.163149e+06 -1.233247e+06 -1.317273e+06 -1.326530e+06 -1.133446e+06 +1.181629e+06 +1.184304e+06 +1.261319e+06 +1.348138e+06 +1.359955e+06 +1.151573e+06 +1.526028e+06 +1.779758e+06 +1.806172e+06 +1.798240e+06 2 @@ -2049,16 +2149,16 @@

Personal Expenditure< 1.060681e+01 1.075113e+01 ... -1.009759e+01 -1.027817e+01 -1.030020e+01 -1.014570e+01 -9.489218e+00 -9.163512e+00 -9.315180e+00 -9.467568e+00 -9.193706e+00 -8.068630e+00 +9.608741e+00 +9.305556e+00 +9.490290e+00 +9.674862e+00 +9.419574e+00 +8.095043e+00 +9.470232e+00 +1.006034e+01 +9.595676e+00 +9.070074e+00 3 @@ -2073,16 +2173,16 @@

Personal Expenditure< 6.763480e+05 6.907760e+05 ... -1.489007e+06 -1.551126e+06 -1.596245e+06 -1.673789e+06 -1.753823e+06 -1.813845e+06 -1.886616e+06 -1.961150e+06 -2.039181e+06 -1.948223e+06 +1.775359e+06 +1.840119e+06 +1.923676e+06 +2.005080e+06 +2.089631e+06 +2.022833e+06 +2.340171e+06 +2.631249e+06 +2.808449e+06 +2.910135e+06 4 @@ -2097,16 +2197,16 @@

Personal Expenditure< 2.101160e+05 2.230240e+05 ... -3.471140e+05 -3.595250e+05 -3.652830e+05 -3.759990e+05 -3.840570e+05 -3.912510e+05 -3.969850e+05 -4.083860e+05 -4.148620e+05 -3.769760e+05 +3.973610e+05 +4.093170e+05 +4.191080e+05 +4.279200e+05 +4.329270e+05 +3.828900e+05 +4.880140e+05 +5.130180e+05 +5.321720e+05 +5.464180e+05 5 @@ -2121,16 +2221,16 @@

Personal Expenditure< 7.387000e+04 8.114200e+04 ... -2.280820e+05 -2.324600e+05 -2.374830e+05 -2.539590e+05 -2.598490e+05 -2.680850e+05 -2.663710e+05 -2.733060e+05 -2.766960e+05 -2.744810e+05 +2.690720e+05 +2.783620e+05 +2.832120e+05 +2.902380e+05 +2.935510e+05 +2.943840e+05 +3.164500e+05 +3.298610e+05 +3.365930e+05 +3.421100e+05 6 @@ -2145,16 +2245,16 @@

Personal Expenditure< 8.012700e+04 8.793500e+04 ... -3.118560e+05 -3.415460e+05 -3.525900e+05 -3.655960e+05 -3.715840e+05 -4.014330e+05 -4.179470e+05 -4.446650e+05 -4.398900e+05 -5.208760e+05 +3.637870e+05 +3.882830e+05 +3.964150e+05 +4.209300e+05 +4.176910e+05 +4.819510e+05 +4.408170e+05 +5.368620e+05 +5.540670e+05 +6.259750e+05 7 @@ -2169,16 +2269,16 @@

Personal Expenditure< 6.383740e+05 7.004430e+05 ... -2.153221e+06 -2.230720e+06 -2.288266e+06 -2.409121e+06 -2.564801e+06 -2.690123e+06 -2.795969e+06 -2.919476e+06 -3.073873e+06 -2.954135e+06 +2.536297e+06 +2.652065e+06 +2.745545e+06 +2.867040e+06 +3.028274e+06 +2.943951e+06 +3.252431e+06 +3.476626e+06 +3.783458e+06 +4.087224e+06 8 @@ -2193,16 +2293,16 @@

Personal Expenditure< 1.991090e+05 2.093990e+05 ... -4.236660e+05 -4.385710e+05 -4.542900e+05 -4.765800e+05 -5.001270e+05 -5.191250e+05 -5.401940e+05 -5.757180e+05 -6.012440e+05 -6.452160e+05 +4.951610e+05 +5.111220e+05 +5.279400e+05 +5.564320e+05 +5.758580e+05 +6.220150e+05 +7.129430e+05 +7.583520e+05 +7.749310e+05 +7.923320e+05 9 @@ -2217,16 +2317,16 @@

Personal Expenditure< 7.475250e+05 7.832550e+05 ... -2.010292e+06 -2.038866e+06 -2.108721e+06 -2.177735e+06 -2.226392e+06 -2.297365e+06 -2.382083e+06 -2.494067e+06 -2.592457e+06 -2.686161e+06 +2.217529e+06 +2.287430e+06 +2.371652e+06 +2.484287e+06 +2.585792e+06 +2.703987e+06 +2.861786e+06 +3.146980e+06 +3.375565e+06 +3.579352e+06 10 @@ -2241,16 +2341,16 @@

Personal Expenditure< 2.500830e+05 2.769950e+05 ... -8.110640e+05 -8.309230e+05 -8.693090e+05 -9.229410e+05 -9.744300e+05 -9.961390e+05 -1.068958e+06 -1.151901e+06 -1.171585e+06 -1.196283e+06 +9.768310e+05 +9.961400e+05 +1.073212e+06 +1.130866e+06 +1.134965e+06 +1.152873e+06 +1.266162e+06 +1.329046e+06 +1.436275e+06 +1.557237e+06 11 @@ -2265,16 +2365,16 @@

Personal Expenditure< 3.262720e+05 3.468410e+05 ... -9.016210e+05 -9.344090e+05 -9.674430e+05 -1.004537e+06 -1.045575e+06 -1.094142e+06 -1.143640e+06 -1.200142e+06 -1.261520e+06 -1.176858e+06 +1.059356e+06 +1.112733e+06 +1.169929e+06 +1.231691e+06 +1.290464e+06 +1.273150e+06 +1.527460e+06 +1.673950e+06 +1.789583e+06 +1.875546e+06 12 @@ -2289,16 +2389,16 @@

Personal Expenditure< 7.056100e+04 7.644200e+04 ... -2.482060e+05 -2.505890e+05 -2.566530e+05 -2.633240e+05 -2.719040e+05 -2.817010e+05 -2.887740e+05 -2.979150e+05 -3.083510e+05 -2.931500e+05 +2.699640e+05 +2.789690e+05 +2.856440e+05 +2.934960e+05 +3.007700e+05 +2.961060e+05 +3.131540e+05 +3.317690e+05 +3.467290e+05 +3.611970e+05 13 @@ -2313,16 +2413,16 @@

Personal Expenditure< -1.521900e+04 -2.003400e+04 ... --1.769600e+04 --2.221000e+04 --4.327200e+04 --4.412700e+04 --5.071600e+04 --4.519200e+04 --3.720300e+04 --2.168300e+04 --4.526000e+03 --9.505000e+03 +-5.058600e+04 +-4.505400e+04 +-3.648000e+04 +-2.452300e+04 +-1.056800e+04 +-1.337900e+04 +1.340000e+04 +4.045800e+04 +5.783300e+04 +5.841000e+04 14 @@ -2337,16 +2437,16 @@

Personal Expenditure< 2.680090e+05 2.900550e+05 ... -7.120960e+05 -7.253700e+05 -7.400500e+05 -7.662350e+05 -7.979410e+05 -8.221010e+05 -8.555290e+05 -8.912160e+05 -9.270130e+05 -8.512650e+05 +8.056780e+05 +8.330580e+05 +8.694520e+05 +9.028470e+05 +9.382330e+05 +9.133230e+05 +1.055130e+06 +1.142912e+06 +1.220941e+06 +1.291900e+06 15 @@ -2355,22 +2455,22 @@

Personal Expenditure< 512995.000000 761975.000000 1.221782e+06 -2.024133e+06 -3.107068e+06 -4.319123e+06 -4.496012e+06 -4.808066e+06 -... -1.188560e+07 -1.250482e+07 -1.251726e+07 -1.319199e+07 -1.374528e+07 -1.413867e+07 -1.480120e+07 -1.562971e+07 -1.621926e+07 -1.743203e+07 +2.024946e+06 +3.105080e+06 +4.318635e+06 +4.501012e+06 +4.804692e+06 +... +1.353285e+07 +1.392890e+07 +1.461393e+07 +1.545404e+07 +1.616450e+07 +1.737480e+07 +1.871440e+07 +1.884401e+07 +2.054680e+07 +2.166053e+07 16 @@ -2379,47 +2479,57 @@

Personal Expenditure< 11.019406 10.040093 1.018103e+01 -1.118928e+01 -1.150329e+01 -1.025511e+01 -9.303223e+00 -9.385998e+00 -... -9.089377e+00 -9.080231e+00 -9.350813e+00 -9.111854e+00 -8.466237e+00 -8.226722e+00 -8.332076e+00 -8.428007e+00 -8.178733e+00 -6.502090e+00 +1.118479e+01 +1.151065e+01 +1.025627e+01 +9.292888e+00 +9.392590e+00 +... +8.731558e+00 +8.502495e+00 +8.630938e+00 +8.723532e+00 +8.413221e+00 +6.627833e+00 +8.154298e+00 +9.444687e+00 +8.790527e+00 +8.301919e+00 -

17 rows × 38 columns

+

17 rows × 42 columns

Personal Consumption

-

Table 3-16: Personal Consumption Expenditures on Transportation by Subcategory (Millions of current dollars) [Source: Bureau of Transportation Statistics]

-
-
# Read Excel file directly from URL
-df_PersonalConsumption = pd.read_excel(
-  "archive-v9.0\\Support Data\\BTS - National - Auto Cost & Gas Price.xlsx",
-  sheet_name="3-16",
-  header=1,
-  usecols="A:AL", # TODO: update cols later for new data
-  nrows=17
-)
-
-# display the data
-df_PersonalConsumption
-
+

Table 3-16: Personal Consumption Expenditures on Transportation by Subcategory (Millions of current dollars) [Source: Bureau of Transportation Statistics]

+
+
+Show the code +
# Ensure file exists
+filepath_3_16 = Path("data/bts/table_03_16_022525.xlsx")
+if not filepath_3_16.exists():
+    filepath_3_16.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://www.bts.gov/sites/bts.dot.gov/files/2025-02/table_03_16_022525.xlsx")
+    filepath_3_16.write_bytes(response.content)
+
+# Read Excel file
+df_PersonalConsumption = pd.read_excel(
+  filepath_3_16,
+  sheet_name="3-16",
+  header=1,
+  usecols="A:AP", # TODO: update cols later for new data
+  nrows=17
+)
+
+# display the data
+df_PersonalConsumption
+
+
@@ -2438,16 +2548,16 @@

Personal Consumption< 1991 1992 ... -2011 -2012 -2013 -2014 2015 2016 2017 2018 -2019 -2020 +(R) 2019 +(R) 2020 +(R) 2021 +(R) 2022 +(R) 2023 +2024 @@ -2464,16 +2574,16 @@

Personal Consumption< 418274 451285 ... -1080327 -1135467 -1170466 -1202035 -1163708 -1163149 -1233247 -1317273 -1326530 -1133446 +1181629 +1184304 +1261319 +1348138 +1359955 +1151573 +1526028 +1779758 +1806172 +1798240 1 @@ -2488,16 +2598,16 @@

Personal Consumption< 409458 444552 ... -1035364 -1087085 -1117565 -1146119 -1108395 -1109942 -1175934 -1250258 -1251856 -1166254 +1130168 +1137129 +1216097 +1288859 +1286787 +1181316 +1517137 +1697656 +1691414 +1653341 2 @@ -2512,16 +2622,16 @@

Personal Consumption< 103658 112410 ... -125483 -139063 -142334 -143986 -144678 -137417 -129250 -119477 -101261 -84689 +150352 +144159 +138687 +130036 +110961 +88566 +107154 +110906 +110598 +96922 3 @@ -2536,16 +2646,16 @@

Personal Consumption< 60337 70115 ... -190904 -207711 -225517 -248602 -279991 -296716 -323258 -351435 -362168 -407737 +287244 +307276 +338759 +368183 +379858 +407445 +534200 +549248 +556734 +542571 4 @@ -2560,16 +2670,16 @@

Personal Consumption< 27803 28727 ... -60733 -63306 -65483 -66821 -69846 -71667 -73499 -75488 -77854 -80449 +75095 +78836 +82624 +84715 +86910 +88771 +104751 +113862 +121604 +126337 5 @@ -2584,16 +2694,16 @@

Personal Consumption< 78832 86705 ... -191898 -198857 -208242 -222249 -232741 -249976 -260974 -272115 -284233 -265126 +228572 +243186 +250915 +260769 +271281 +255343 +291681 +319342 +332092 +335032 6 @@ -2608,16 +2718,16 @@

Personal Consumption< 108852 112864 ... -386787 -397808 -392996 -377002 -289690 -259154 -291022 -328430 -316670 -228740 +297404 +268630 +302501 +341696 +328716 +238409 +361108 +481699 +439298 +414547 7 @@ -2632,16 +2742,16 @@

Personal Consumption< 5546 6427 ... -17797 -18616 -19971 -21481 -23204 -23926 -24953 -25694 -26659 -17146 +23256 +23956 +25008 +25841 +26017 +21569 +23798 +26402 +29244 +29049 8 @@ -2656,16 +2766,16 @@

Personal Consumption< 24430 27304 ... -61762 -61724 -63022 -65978 68245 71086 -72978 +77603 77619 -83011 -82367 +83044 +81213 +94445 +96197 +101844 +108883 9 @@ -2680,16 +2790,16 @@

Personal Consumption< 28827 29338 ... -95751 -100109 -106391 -112037 -113811 -115954 -123494 -136167 -150094 -65075 +111544 +112385 +119603 +131286 +146224 +65490 +125357 +188120 +209985 +237909 10 @@ -2704,16 +2814,16 @@

Personal Consumption< 697 546 ... -1085 -1152 -1210 -1250 -1227 -1241 -1286 -1285 -1348 -407 +1239 +1257 +1307 +1306 +1370 +413 +689 +1110 +1360 +1482 11 @@ -2728,16 +2838,16 @@

Personal Consumption< 674 682 ... -1146 -1128 -1149 -1167 -1130 -1227 -1329 -1324 -1322 -802 +1268 +1358 +1451 +1446 +1441 +855 +913 +1082 +1177 +1168 12 @@ -2752,16 +2862,16 @@

Personal Consumption< 25069 25581 ... -78636 -82102 -87210 -91545 -91757 -92418 -97851 -107670 -120355 -49649 +89988 +89627 +94749 +104257 +116539 +48533 +101042 +153028 +168542 +188669 13 @@ -2776,16 +2886,16 @@

Personal Consumption< 2387 2529 ... -14884 -15727 -16822 -18075 -19697 -21068 -23028 -25888 -27069 -14217 +19049 +20143 +22096 +24277 +26874 +15689 +22713 +32900 +38906 +46590 14 @@ -2800,16 +2910,16 @@

Personal Consumption< 10468 11153 ... -22918 -23469 -25333 -27275 -28914 -29820 -31457 -35399 -34327 -16094 +30120 +31522 +33879 +38547 +42762 +24053 +26752 +37823 +45577 +54241 15 @@ -2824,16 +2934,16 @@

Personal Consumption< 7843 8567 ... -17534 -18095 -19076 -19732 -20233 -20507 -20675 -20926 -21302 -8568 +20357 +20661 +20858 +21068 +21434 +11030 +11670 +14982 +17086 +18274 16 @@ -2848,44 +2958,113 @@

Personal Consumption< 2625 2586 ... -5384 -5374 -6257 -7543 -8681 -9313 -10782 -14473 -13025 -7526 +9763 +10861 +13021 +17479 +21328 +13023 +15082 +22841 +28491 +35967 -

17 rows × 38 columns

+

17 rows × 42 columns

Consumer Price Index

-

Data Source:

-
-
# Read Excel file directly from URL
-df_CPI = pd.read_excel(
-  "archive-v9.0\\1 - Auto Operating Cost - 2022-01-11.xlsx", # File path
-  sheet_name="CPI",
-  header=5,
-  usecols="B:Q", # TODO: update cols later for new data
-  nrows=131
-)
-
-# Remove rows where all elements are NaN (empty)
-df_CPI = df_CPI.dropna(how='all')
-
-# display the data
-df_CPI
-
+

Data Source: Consumer Price Index for All Urban Consumers (CPI-U) [Source: Bureau of Labor Statistics]

+
+
+
+ +
+
+Tip +
+
+
+

Create a .env file in the root directory and add your BLS API key: BLS_PUBLIC_API=your-key-here This enables fetching Consumer Price Index data from the BLS API.

+
+
+
+
+Show the code +
from dotenv import load_dotenv
+load_dotenv()
+
+
+
True
+
+
+
+
+Show the code +
# TODO: the cpi_1913_present.xlsx file seems problematic. It automatically truncates rows after 2013. Need to investigate further.
+
+# Ensure file exists
+filepath_cpi = Path("data/bls/cpi_1913_present.xlsx")
+
+if not filepath_cpi.exists():
+    filepath_cpi.parent.mkdir(parents=True, exist_ok=True)
+
+    api_url = "https://api.bls.gov/publicAPI/v2/timeseries/data/"
+    current_year = pd.Timestamp.now().year
+    all_data = []
+
+    for start_year in range(1913, current_year + 1, 20):
+        end_year = min(start_year + 19, current_year)
+        payload = {
+            "seriesid": ["CUUR0000SA0"],
+            "startyear": str(start_year),
+            "endyear": str(end_year),
+            "catalog": False,
+            "calculations": False,
+            "annualaverage": False,
+            "registrationkey": os.getenv('BLS_PUBLIC_API')
+        }
+        response = requests.post(api_url, json=payload, headers={"Content-Type": "application/json"})
+
+        for item in response.json()['Results']['series'][0]['data']:
+            if item['period'].startswith('M') and item['period'] != 'M13':
+                all_data.append({
+                    'year': int(item['year']),
+                    'period': item['period'],
+                    'value': float(item['value'])
+                })
+
+    df_pivot = pd.DataFrame(all_data).pivot(index='year', columns='period', values='value')
+    df_pivot = df_pivot[[f'M{i:02d}' for i in range(1, 13)]].sort_index()
+
+    with pd.ExcelWriter(filepath_cpi, engine='openpyxl') as writer:
+        df_pivot.to_excel(writer, sheet_name='BLS Data Series')
+
+# Read Excel file directly from URL
+df_CPI = pd.read_excel(
+  filepath_cpi, # File path
+  sheet_name="BLS Data Series",
+  usecols="A:M" # TODO: update cols later for new data
+)
+
+# Calculate annual average
+df_CPI['annualaverage'] = df_CPI[[f'M{i:02d}' for i in range(1, 13)]].mean(axis=1)
+
+# Calculate 12-month percent change for December
+df_CPI['pct_change_Dec'] = df_CPI['M12'].pct_change(periods=1, fill_method=None) * 100
+
+# Calculate 12-month percent change for annual average
+df_CPI['pct_change_Avg'] = df_CPI['annualaverage'].pct_change(periods=1, fill_method=None) * 100
+
+# display the data
+df_CPI
+
+
@@ -2893,28 +3072,28 @@

Consumer Price Index< -Year -Jan. -Feb. -Mar. -Apr. -May -June -July -Aug. -Sep. -Oct. -Nov. -Dec. -Avg. -Dec -Avg +year +M01 +M02 +M03 +M04 +M05 +M06 +M07 +M08 +M09 +M10 +M11 +M12 +annualaverage +pct_change_Dec +pct_change_Avg -1 -1913.0 +0 +1913 9.800 9.800 9.800 @@ -2927,13 +3106,13 @@

Consumer Price Index< 10.000 10.100 10.000 -9.900 +9.883333 NaN NaN -2 -1914.0 +1 +1914 10.000 9.900 9.900 @@ -2946,13 +3125,13 @@

Consumer Price Index< 10.100 10.200 10.100 -10.000 -1.0 -1.0 +10.016667 +1.000000 +1.349073 -3 -1915.0 +2 +1915 10.100 10.000 9.900 @@ -2965,13 +3144,13 @@

Consumer Price Index< 10.200 10.300 10.300 -10.100 -2.0 -1.0 +10.108333 +1.980198 +0.915141 -5 -1916.0 +3 +1916 10.400 10.400 10.500 @@ -2984,13 +3163,13 @@

Consumer Price Index< 11.300 11.500 11.600 -10.900 -12.6 -7.9 +10.883333 +12.621359 +7.666941 -6 -1917.0 +4 +1917 11.700 12.000 12.000 @@ -3003,9 +3182,9 @@

Consumer Price Index< 13.500 13.500 13.700 -12.800 -18.1 -17.4 +12.825000 +18.103448 +17.840735 ... @@ -3027,104 +3206,104 @@

Consumer Price Index< ... -125 -2016.0 -236.916 -237.111 -238.132 -239.261 -240.229 -241.018 -240.628 -240.849 -241.428 -241.729 -241.353 -241.432 -240.007 -2.1 -1.3 - - -126 -2017.0 -242.839 -243.603 -243.801 -244.524 -244.733 -244.955 -244.786 -245.519 -246.819 -246.663 -246.669 -246.524 -245.120 -2.1 -2.1 - - -127 -2018.0 -247.867 -248.991 -249.554 -250.546 -251.588 -251.989 -252.006 -252.146 -252.439 -252.885 -252.038 -251.233 -251.107 -1.9 -2.4 - - -128 -2019.0 -251.712 -252.776 -254.202 -255.548 -256.092 -256.143 -256.571 -256.558 -256.759 -257.346 -257.208 -256.974 -255.657 -2.3 -1.8 - - -129 -2020.0 -257.971 -258.678 -258.115 -256.389 -256.394 -257.797 -259.101 -259.918 -260.280 -260.388 -260.229 -260.474 -258.811 -1.4 -1.2 +108 +2021 +261.582 +263.014 +264.877 +267.054 +269.195 +271.696 +273.003 +273.567 +274.310 +276.589 +277.948 +278.802 +270.969750 +7.036403 +4.697859 + + +109 +2022 +281.148 +283.716 +287.504 +289.109 +292.296 +296.311 +296.276 +296.171 +296.808 +298.012 +297.711 +296.797 +292.654917 +6.454401 +8.002800 + + +110 +2023 +299.170 +300.840 +301.836 +303.363 +304.127 +305.109 +305.691 +307.026 +307.789 +307.671 +307.051 +306.746 +304.701583 +3.352123 +4.116338 + + +111 +2024 +308.417 +310.326 +312.332 +313.548 +314.069 +314.175 +314.540 +314.796 +315.301 +315.664 +315.493 +315.605 +313.688833 +2.888057 +2.949525 + + +112 +2025 +317.671 +319.082 +319.799 +320.795 +321.465 +322.561 +323.048 +323.976 +NaN +NaN +NaN +NaN +321.049625 +NaN +2.346527 -

108 rows × 16 columns

+

113 rows × 16 columns

@@ -3132,20 +3311,28 @@

Consumer Price Index<

Retail Diesel Prices

Retail Prices for Diesel (On-Highway) - All Types [Source: Energy Information Administration]

-

File URL: https://www.eia.gov/dnav/pet/xls/PET_PRI_GND_A_EPD2D_PTE_DPGAL_W.xls

-
-
# Read Excel file directly from URL
-df_RetailDieselPrices = pd.read_excel(
-  "archive-v9.0\\1 - Auto Operating Cost - 2022-01-11.xlsx", # File path
-  sheet_name="Retail Diesel Prices",
-  header=22,
-  usecols="A:J", # TODO: update cols later for new data
-  nrows=1451
-)
-
-# display the data
-df_RetailDieselPrices
-
+
+
+Show the code +
# Ensure file exists
+filepath_retaildiesel = Path("data/eia/PET_PRI_GND_A_EPD2D_PTE_DPGAL_W.xls")
+if not filepath_retaildiesel.exists():
+    filepath_retaildiesel.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://www.eia.gov/dnav/pet/xls/PET_PRI_GND_A_EPD2D_PTE_DPGAL_W.xls")
+    filepath_retaildiesel.write_bytes(response.content)
+
+# Read Excel file directly from URL
+df_RetailDieselPrices = pd.read_excel(
+  filepath_retaildiesel, # File path
+  sheet_name="Data 2",
+  header=2,
+  usecols="A:J" # TODO: update cols later for new data
+)
+
+# display the data
+df_RetailDieselPrices
+
+
@@ -3245,74 +3432,74 @@

Retail Diesel Prices< ... -1446 -2021-12-06 -3.658 -3.654 -3.824 -3.556 -3.536 -3.402 -3.780 -4.416 -3.992 +1641 +2025-09-01 +3.750 +3.948 +3.912 +3.669 +3.722 +3.367 +3.753 +4.484 +4.112 -1447 -2021-12-13 -3.633 -3.643 -3.811 -3.521 -3.512 -3.372 -3.758 -4.398 -3.970 +1642 +2025-09-08 +3.772 +3.955 +3.937 +3.693 +3.754 +3.404 +3.754 +4.533 +4.163 -1448 -2021-12-20 -3.611 -3.633 -3.792 -3.496 -3.492 -3.339 -3.731 -4.381 -3.941 - - -1449 -2021-12-27 -3.602 -3.623 -3.779 -3.488 -3.479 -3.330 -3.704 -4.371 -3.917 +1643 +2025-09-15 +3.748 +3.961 +3.920 +3.663 +3.710 +3.389 +3.722 +4.523 +4.134 - -1450 -2022-01-03 -3.604 -3.622 -3.781 -3.490 -3.477 -3.328 -3.687 -4.369 -3.927 + +1644 +2025-09-22 +3.745 +3.962 +3.908 +3.664 +3.731 +3.400 +3.747 +4.524 +4.123 + + +1645 +2025-09-29 +3.750 +3.962 +3.902 +3.673 +3.731 +3.413 +3.732 +4.532 +4.143 -

1451 rows × 10 columns

+

1646 rows × 10 columns

@@ -3320,20 +3507,28 @@

Retail Diesel Prices<

Retail Gas Prices

Retail Prices for Gasoline, All Grades [Source: Energy Information Administration]

-

File URL: https://www.eia.gov/dnav/pet/xls/PET_PRI_GND_A_EPM0_PTE_DPGAL_W.xls

-
-
# Read Excel file directly from URL
-df_RetailGasPrices = pd.read_excel(
-  "archive-v9.0\\1 - Auto Operating Cost - 2022-01-11.xlsx", # File path
-  sheet_name="Retail Gas Prices",
-  header=22,
-  usecols="A:J", # TODO: update cols later for new data
-  nrows=1501
-)
-
-# display the data
-df_RetailGasPrices
-
+
+
+Show the code +
# Ensure file exists
+filepath_retailgas = Path("data/eia/PET_PRI_GND_A_EPM0_PTE_DPGAL_W.xls")
+if not filepath_retailgas.exists():
+    filepath_retailgas.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://www.eia.gov/dnav/pet/xls/PET_PRI_GND_A_EPM0_PTE_DPGAL_W.xls")
+    filepath_retailgas.write_bytes(response.content)
+
+# Read Excel file directly from URL
+df_RetailGasPrices = pd.read_excel(
+  filepath_retailgas, # File path
+  sheet_name="Data 2",
+  header=2,
+  usecols="A:J" # TODO: update cols later for new data
+)
+
+# display the data
+df_RetailGasPrices
+
+
@@ -3433,94 +3628,109 @@

Retail Gas Prices

... -1496 -2021-12-06 -3.380 -3.484 -3.531 -3.258 -3.167 -3.061 -3.579 -4.285 -3.853 +1691 +2025-09-01 +3.126 +3.204 +3.266 +3.017 +3.174 +2.863 +3.308 +4.277 +3.983 -1497 -2021-12-13 -3.359 -3.467 -3.526 -3.226 -3.144 -3.012 -3.543 -4.265 -3.826 - - -1498 -2021-12-20 +1692 +2025-09-08 +3.175 +3.243 3.340 -3.458 -3.519 -3.198 -3.111 -3.011 -3.520 -4.251 -3.808 - - -1499 -2021-12-27 -3.328 -3.448 -3.507 -3.183 -3.092 -2.978 -3.499 -4.235 -3.795 - - -1500 -2022-01-03 -3.321 -3.444 -3.496 -3.177 +3.054 +3.140 +2.830 +3.369 +4.322 +4.051 + + +1693 +2025-09-15 +3.131 +3.229 +3.303 +2.996 +3.065 +2.873 +3.305 +4.395 +4.166 + + +1694 +2025-09-22 +3.143 +3.207 +3.301 +3.027 3.093 -3.015 -3.476 -4.249 -3.806 +2.814 +3.313 +4.394 +4.162 + + +1695 +2025-09-29 +3.097 +3.169 +3.262 +2.973 +3.013 +2.770 +3.239 +4.363 +4.118 -

1501 rows × 10 columns

+

1696 rows × 10 columns

Average Cost

-

Table 3-17: Average Cost of Owning and Operating an Automobilea (Assuming 15,000 Vehicle-Miles per Year) [Source: Bureau of Transportation Statistics]

-
-
# Read Excel file directly from URL
-df_AverageCost = pd.read_excel(
-  "archive-v9.0\\Support Data\\BTS - National - Auto Cost & Gas Price.xlsx",
-  sheet_name="3-17",
-  header=1,
-  usecols="A:AI", # TODO: update cols later for new data
-  nrows=8
-)
-
-# display the data
-df_AverageCost
-
+

Table 3-17: Average Cost of Owning and Operating an Automobilea (Assuming 15,000 Vehicle-Miles per Year) [Source: Bureau of Transportation Statistics]

+
+
+Show the code +
# Ensure file exists
+filepath_3_17 = Path("data/bts/table_03_17_032725.xlsx")
+if not filepath_3_17.exists():
+    filepath_3_17.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://www.bts.gov/sites/bts.dot.gov/files/2025-03/table_03_17_032725.xlsx")
+    filepath_3_17.write_bytes(response.content)
+
+# Read Excel file directly from URL
+df_AverageCost = pd.read_excel(
+  filepath_3_17,
+  sheet_name="3-17",
+  header=1,
+  usecols="A:AM", # TODO: update cols later for new data
+  nrows=8
+)
+
+df_AverageCost.columns = [
+    str(int(match.group())) if (match := re.search(r'\b(19|20)\d{2}\b', str(col))) else col
+    for col in df_AverageCost.columns
+]
+
+# display the data
+df_AverageCost
+
+
@@ -3539,16 +3749,16 @@

Average Cost

1994 1995 ... -2011 -2012 -2013 -2014 2015 2016 2017 2018 2019 2020 +2021 +2022 +2023 +2024 @@ -3565,16 +3775,16 @@

Average Cost

39.440000 41.233333 ... -58.506667 -59.640000 -60.813333 -59.173333 57.986667 57.053333 56.453333 58.993333 61.88 63.74 +64.44 +71.526667 +81.213333 +81.973333 1 @@ -3589,16 +3799,16 @@

Average Cost

5.600000 5.800000 ... -12.340000 -14.170000 -14.450000 -13.000000 11.210000 8.450000 10.26 11.05 11.6 10.66 +10.72 +17.99 +15.93 +14.9 2 @@ -3613,16 +3823,16 @@

Average Cost

14.198783 14.066289 ... -21.091613 -23.759222 -23.761237 -21.969356 19.332030 14.810703 18.174303 18.73093 18.74596 16.724192 +16.63563 +25.151459 +19.615006 +18.176643 3 @@ -3637,16 +3847,16 @@

Average Cost

2.500000 2.600000 ... -4.440000 -4.470000 -4.970000 -5.060000 5.110000 5.280000 7.91 8.21 8.94 9.12 +9.55 +9.68 +9.83 +10.13 4 @@ -3661,16 +3871,16 @@

Average Cost

1.000000 1.200000 ... -0.960000 -1.000000 -1.000000 -0.970000 0.980000 1.000000 U U U U +U +U +U +U 5 @@ -3685,20 +3895,20 @@

Average Cost

5916.000000 6185.000000 ... -8776.000000 -8946.000000 -9122.000000 -8876.000000 8698.000000 8558.000000 8468 8849 9282 9561 +9666 +10729 +12182 +12296 6 -Variable cost +Variable costd 968.000000 1143.000000 1113.000000 @@ -3709,20 +3919,20 @@

Average Cost

1365.000000 1440.000000 ... -2662.000000 -2946.000000 -3064.000000 -2855.000000 2596.000000 2208.000000 2726 2889 3081 2968 +3042 +4151 +3864 +3755 7 -Fixed costd +Fixed coste 1186.000000 2033.000000 2371.000000 @@ -3733,21 +3943,21 @@

Average Cost

4551.000000 4745.000000 ... -6114.000000 -6000.000000 -6058.000000 -6021.000000 6102.000000 6350.000000 5742 5960 6201 6593 +6624 +6578 +8318 +8541 -

8 rows × 35 columns

+

8 rows × 39 columns

@@ -3755,20 +3965,29 @@

Average Cost

4-11

Table 4-11: Light Duty Vehicle, Short Wheel Base and Motorcycle Fuel Consumption and Travel [Source: Bureau of Transportation Statistics]

-

File URL: https://www.bts.gov/sites/bts.dot.gov/files/2025-03/table_04_11_032825.xlsx

-
-
# Read Excel file directly from URL
-df_4_11 = pd.read_excel(
-  "archive-v9.0\\Support Data\\BTS - National - Fuel Efficiency.xlsx",
-  sheet_name="4-11",
-  header=1,
-  usecols="A:AK", # TODO: update cols later for new data
-  nrows=18
-)
-
-# display the data
-df_4_11
-
+
+
+Show the code +
# Ensure file exists
+filepath_4_11 = Path("data/bts/table_04_11_032825.xlsx")
+if not filepath_4_11.exists():
+    filepath_4_11.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://www.bts.gov/sites/bts.dot.gov/files/2025-03/table_04_11_032825.xlsx")
+    filepath_4_11.write_bytes(response.content)
+
+# Read Excel file directly from URL
+df_4_11 = pd.read_excel(
+  filepath_4_11,
+  sheet_name="4-11",
+  header=1,
+  usecols="A:AO", # TODO: update cols later for new data
+  nrows=18
+)
+
+# display the data
+df_4_11
+
+
@@ -3787,16 +4006,16 @@

4-11

1991 1992 ... -2010 -2011 -2012 -2013 2014 2015 2016 2017 2018 2019 +2020 +2021 +2022 +2023 @@ -3837,16 +4056,16 @@

4-11

128299.601 126581.148 ... -1.902028e+05 -1.835226e+05 -1.831719e+05 -1.844975e+05 1.875549e+05 1.896183e+05 1.927745e+05 1.936724e+05 1.928562e+05 1.943488e+05 +1.948830e+05 +1.970928e+05 +1.970804e+05 +1.971343e+05 2 @@ -3861,16 +4080,16 @@

4-11

4177.365 4065.118 ... -8.009503e+03 -8.437502e+03 -8.454939e+03 -8.404687e+03 8.417718e+03 8.600936e+03 8.679380e+03 8.715204e+03 8.666185e+03 8.596314e+03 +8.347435e+03 +9.795491e+03 +9.567664e+03 +9.516910e+03 3 @@ -3909,16 +4128,16 @@

4-11

1367363.284333 1381126.078561 ... -2.025745e+06 -2.046282e+06 -2.062828e+06 -2.074423e+06 2.072071e+06 2.147840e+06 2.191764e+06 2.220801e+06 2.232588e+06 2.254309e+06 +1.934743e+06 +2.083898e+06 +2.137805e+06 +2.173555e+06 5 @@ -3933,16 +4152,16 @@

4-11

U U ... -1.851290e+04 -1.854223e+04 -2.138531e+04 -2.036618e+04 1.996967e+04 1.960631e+04 2.044530e+04 2.014930e+04 2.007618e+04 1.968805e+04 +1.794747e+04 +1.964186e+04 +2.376486e+04 +2.018138e+04 6 @@ -3981,16 +4200,16 @@

4-11

64501.153523 65626.886464 ... -8.678852e+04 -8.835866e+04 -8.860021e+04 -8.861101e+04 8.930079e+04 9.003127e+04 9.148781e+04 9.171216e+04 9.158533e+04 -9.342037e+04 +9.342598e+04 +7.652800e+04 +8.530694e+04 +8.604020e+04 +8.814518e+04 8 @@ -4005,16 +4224,16 @@

4-11

U U ... -4.267318e+02 -4.263775e+02 -4.911303e+02 -4.677127e+02 4.586283e+02 4.478787e+02 4.658022e+02 4.584286e+02 4.566574e+02 -4.478637e+02 +4.478618e+02 +4.081698e+02 +4.468024e+02 +5.405720e+02 +4.590652e+02 9 @@ -4053,16 +4272,16 @@

4-11

10.65758 10.910993 ... -1.065045e+01 -1.115003e+01 -1.126171e+01 -1.124364e+01 1.104781e+01 1.132718e+01 1.136957e+01 1.146679e+01 1.157644e+01 1.159929e+01 +9.927714e+00 +1.057318e+01 +1.084738e+01 +1.102576e+01 11 @@ -4077,16 +4296,16 @@

4-11

U U ... -2.311367e+00 -2.197598e+00 -2.529328e+00 -2.423193e+00 2.372338e+00 2.279556e+00 2.355618e+00 2.311971e+00 2.316611e+00 2.290289e+00 +2.150058e+00 +2.005194e+00 +2.483873e+00 +2.120581e+00 12 @@ -4125,16 +4344,16 @@

4-11

21.199052 21.045126 ... -2.334116e+01 -2.315882e+01 -2.328242e+01 -2.341044e+01 2.320328e+01 2.385661e+01 2.395690e+01 2.421490e+01 2.437713e+01 -2.413081e+01 +2.412936e+01 +2.528150e+01 +2.442823e+01 +2.484659e+01 +2.465881e+01 14 @@ -4149,16 +4368,16 @@

4-11

U U ... -4.338299e+01 -4.348783e+01 -4.354306e+01 -4.354421e+01 4.354216e+01 4.377595e+01 4.389267e+01 4.395297e+01 4.396332e+01 -4.395991e+01 +4.396009e+01 +4.397059e+01 +4.396095e+01 +4.396244e+01 +4.396189e+01 15 @@ -4197,16 +4416,16 @@

4-11

502.738536 518.457033 ... -4.562947e+02 -4.814592e+02 -4.836999e+02 -4.802830e+02 4.761314e+02 4.748026e+02 4.745846e+02 4.735428e+02 4.748892e+02 -4.806840e+02 +4.807129e+02 +3.926869e+02 +4.328262e+02 +4.365741e+02 +4.471326e+02 17 @@ -4221,41 +4440,51 @@

4-11

U U ... -5.327819e+01 -5.053362e+01 -5.808798e+01 -5.564904e+01 5.448369e+01 5.207325e+01 5.366769e+01 5.260102e+01 5.269416e+01 -5.209950e+01 +5.209928e+01 +4.889764e+01 +4.561307e+01 +5.649989e+01 +4.823679e+01 -

18 rows × 37 columns

+

18 rows × 41 columns

Fuel Economy - Medium

-

Table 4-13: Single-Unit 2-Axle 6-Tire or More Truck Fuel Consumption and Travel [Source: Bureau of Transportation Statistics]

-
-
# Read Excel file directly from URL
-df_FE_Medium = pd.read_excel(
-  "archive-v9.0\\Support Data\\BTS - National - Fuel Efficiency.xlsx",
-  sheet_name="Medium",
-  header=1,
-  usecols="A:AI", # TODO: update cols later for new data
-  nrows=6
-)
-
-# display the data
-df_FE_Medium
-
+

Table 4-13: Single-Unit 2-Axle 6-Tire or More Truck Fuel Consumption and Travel [Source: Bureau of Transportation Statistics]

+
+
+Show the code +
# Ensure file exists
+filepath_4_13 = Path("data/bts/table_04_13_032725.xlsx")
+if not filepath_4_13.exists():
+    filepath_4_13.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://www.bts.gov/sites/bts.dot.gov/files/2025-03/table_04_13_032725.xlsx")
+    filepath_4_13.write_bytes(response.content)
+
+# Read Excel file directly from URL
+df_FE_Medium = pd.read_excel(
+  filepath_4_13,
+  sheet_name="4-13",
+  header=1,
+  usecols="A:AM", # TODO: update cols later for new data
+  nrows=6
+)
+
+# display the data
+df_FE_Medium
+
+
@@ -4274,16 +4503,16 @@

Fuel Economy - Mediu 1993 1994 ... -2010 -2011 -2012 -2013 2014 2015 2016 2017 2018 2019 +2020 +2021 +2022 +2023 @@ -4298,18 +4527,18 @@

Fuel Economy - Mediu 4480.815015 4369.842228 4407.850444 -4724.608000 +4906.384535 ... -8217.189071 -7819.054746 -8190.286364 -8126.007221 8328.758599 8456.302000 8746.518000 9336.998000 10327.899000 10160.433000 +9908.409000 +10713.550000 +11083.997000 +11567.428000 1 @@ -4324,16 +4553,16 @@

Fuel Economy - Mediu 56772.473176 61284.000000 ... -110738.245206 -103803.030273 -105605.222597 -106581.578905 109301.406197 109597.318450 113337.941633 116102.399109 120698.994215 124745.707181 +117832.173934 +131637.174902 +136223.786866 +134100.608119 2 @@ -4348,16 +4577,16 @@

Fuel Economy - Mediu 8488.204295 9031.771537 ... -15096.529868 -14215.430675 -14376.472744 -14501.925786 14893.865294 14850.509537 15338.478728 15599.855130 16080.121829 -16656.735671 +16656.910752 +15576.749998 +17169.259790 +17180.849601 +17162.839167 3 @@ -4370,18 +4599,18 @@

Fuel Economy - Mediu 11.805424 12.328648 12.879855 -12.971235 +12.490664 ... -13.476414 -13.275650 -12.893960 -13.116107 13.123373 12.960431 12.958064 12.434660 11.686694 12.277598 +11.892139 +12.286980 +12.290132 +11.592949 4 @@ -4396,16 +4625,16 @@

Fuel Economy - Mediu 6.688396 6.785380 ... -7.335344 -7.302138 -7.345698 -7.349478 7.338686 7.380038 7.389125 7.442531 7.506099 -7.489205 +7.489126 +7.564619 +7.667027 +7.928816 +7.813428 5 @@ -4418,43 +4647,53 @@

Fuel Economy - Mediu 1823.860597 1884.948340 1925.701519 -1911.644635 +1840.820154 ... -1837.189060 -1818.049769 -1755.307703 -1784.631171 1788.245525 1756.147018 1753.666857 1670.757039 1556.959632 -1639.372620 +1639.389852 +1572.073781 +1602.574291 +1550.059027 +1483.721288 -

6 rows × 35 columns

+

6 rows × 39 columns

Fuel Economy - Heavy

-

Table 4-14: Combination Truck Fuel Consumption and Travel [Source: Bureau of Transportation Statistics]

-
-
# Read Excel file directly from URL
-df_FE_Heavy = pd.read_excel(
-  "archive-v9.0\\Support Data\\BTS - National - Fuel Efficiency.xlsx",
-  sheet_name="Heavy",
-  header=1,
-  usecols="A:AJ", # TODO: update cols later for new data
-  nrows=6
-)
-
-# display the data
-df_FE_Heavy
-
+

Table 4-14: Combination Truck Fuel Consumption and Travel [Source: Bureau of Transportation Statistics]

+
+
+Show the code +
# Ensure file exists
+filepath_4_14 = Path("data/bts/table_04_14_032725.xlsx")
+if not filepath_4_14.exists():
+    filepath_4_14.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://www.bts.gov/sites/bts.dot.gov/files/2025-03/table_04_14_032725.xlsx")
+    filepath_4_14.write_bytes(response.content)
+
+# Read Excel file directly from URL
+df_FE_Heavy = pd.read_excel(
+  filepath_4_14,
+  sheet_name="4-14",
+  header=1,
+  usecols="A:AN", # TODO: update cols later for new data
+  nrows=6
+)
+
+# display the data
+df_FE_Heavy
+
+
@@ -4473,16 +4712,16 @@

Fuel Economy - Heavy< 1992 1993 ... -2010 -2011 -2012 -2013 2014 2015 2016 2017 2018 2019 +2020 +2021 +2022 +2023 @@ -4499,16 +4738,16 @@

Fuel Economy - Heavy< 1675.362942 1680.305013 ... -2552.865009 -2451.638193 -2469.093851 -2471.348703 2577.197369 2746.882000 2752.043000 2892.218000 2906.011000 2925.210000 +2990.962000 +3142.854000 +3249.824000 +3324.112000 1 @@ -4523,16 +4762,16 @@

Fuel Economy - Heavy< 99509.826717 103115.689682 ... -175788.971737 -163791.293119 -163601.731106 -168435.634141 169830.178385 170246.278000 174556.978274 181490.181698 184165.121151 175304.701353 +179816.800923 +195389.157346 +195048.639383 +195757.795420 2 @@ -4547,16 +4786,16 @@

Fuel Economy - Heavy< 17216.232996 17747.967243 ... -29926.663579 -28181.038987 -27975.331348 -28794.994112 29117.656112 28885.913526 29554.641135 30363.560805 30325.060257 -28986.514576 +28987.013626 +29186.467609 +30439.396787 +28218.174604 +29296.988806 3 @@ -4571,16 +4810,16 @@

Fuel Economy - Heavy< 59.395982 61.367245 ... -68.859486 -66.808917 -66.259827 -68.155349 65.897234 61.978009 63.428143 62.751211 63.373855 59.928929 +60.120055 +62.169340 +60.018216 +58.890253 4 @@ -4595,16 +4834,16 @@

Fuel Economy - Heavy< 5.780000 5.810000 ... -5.873992 -5.812110 -5.848071 -5.849476 5.832550 5.893747 5.906246 5.977236 6.073034 -6.047802 +6.047698 +6.160965 +6.418956 +6.912164 +6.681840 5 @@ -4619,54 +4858,62 @@

Fuel Economy - Heavy< 10276.121406 10562.348563 ... -11722.775576 -11494.778906 -11330.201701 -11651.530224 11298.186339 10515.891664 10739.164008 10498.365201 10435.287498 -9909.208083 +9909.378686 +9758.220803 +9685.272299 +8682.985480 +8813.478248 -

6 rows × 36 columns

+

6 rows × 40 columns

Fuel Economy by Size Class

-

Table 5.5 Truck Harmonic Mean Fuel Economy by Size Class, 1992, 1997, and 2002 (miles per gallon)

-
-
# FIXME: Need to verify the source of this.
-
-# Read Excel file directly from URL
-df_FE_SizeClass_1 = pd.read_excel(
-  "archive-v9.0\\1 - Auto Operating Cost - 2022-01-11.xlsx", # File path
-  sheet_name="Fuel Economy by Size Class",
-  usecols="A:G", # TODO: update cols later for new data
-  skiprows=11,   # Skip the first 11 rows
-  nrows=11
-)
-
-# Drop columns that are entirely empty (NaN)
-df_FE_SizeClass_1 = df_FE_SizeClass_1.dropna(axis=1, how='all')
-
-# Manually set column names
-df_FE_SizeClass_1.columns = [
-    "Manufacturer's gross vehicle weight class",
-    "1992 TIUS",
-    "1997 VIUS",
-    "2002 VIUS"
-]
-
-# display the data
-df_FE_SizeClass_1
-
+

Table 5.6 Truck Harmonic Mean Fuel Economy by Size Class, 1992, 1997, and 2002 (miles per gallon) [Source: Oak Ridge National Laboratory]

+
+
+Show the code +
# Ensure file exists
+filepath_tedb = Path("data/doe/TEDB_Ed_40.pdf")
+if not filepath_tedb.exists():
+    filepath_tedb.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://tedb.ornl.gov/wp-content/uploads/2022/03/TEDB_Ed_40.pdf")
+    filepath_tedb.write_bytes(response.content)
+
+# Read Table 5.6 in Page 152
+df_FE_SizeClass_1 = pd.DataFrame({
+    "Manufacturer's gross vehicle weight class": [
+        "1) 6,000 lb and less",
+        "2) 6,001–10,000 lb",
+        "3) 10,000–14,000 lb",
+        "4) 14,001–16,000 lb",
+        "5) 16,001–19,500 lb",
+        "6) 19,501–26,000 lb",
+        "7) 26,001–33,000 lb",
+        "8) 33,001 lb and over",
+        "Light truck subtotal (1–2)",
+        "Medium truck subtotal (3–6)",
+        "Large truck subtotal (7–8)"
+    ],
+    "1992 TIUS": [17.2, 13.0, 8.8, 8.8, 7.4, 6.9, 6.5, 5.5, 15.7, 7.3, 5.6],
+    "1997 VIUS": [17.1, 13.6, 9.4, 9.3, 8.7, 7.3, 6.4, 5.7, 15.8, 8.6, 6.1],
+    "2002 VIUS": [17.6, 14.3, 10.5, 8.5, 7.9, 7.0, 6.4, 5.7, 16.2, 8.0, 5.8]
+})
+
+# display the data
+df_FE_SizeClass_1
+
+
@@ -4683,77 +4930,77 @@

Fuel Economy by 0 -1) 6,000 lbs and less +1) 6,000 lb and less 17.2 17.1 17.6 1 -2) 6,001–10,000 lbs +2) 6,001–10,000 lb 13.0 13.6 14.3 2 -Light truck subtotal -15.7 -15.8 -16.2 - - -3 -3) 10,000–14,000 lbs +3) 10,000–14,000 lb 8.8 9.4 10.5 - -4 -4) 14,001–16,000 lbs + +3 +4) 14,001–16,000 lb 8.8 9.3 8.5 - -5 -5) 16,001–19,500 lbs + +4 +5) 16,001–19,500 lb 7.4 8.7 7.9 - -6 -6) 19,501–26,000 lbs + +5 +6) 19,501–26,000 lb 6.9 7.3 7.0 - -7 -Medium truck subtotal -7.3 -8.6 -8.0 - -8 -7) 26,001–33,000 lbs +6 +7) 26,001–33,000 lb 6.5 6.4 6.4 -9 -8) 33,001 lbs and over +7 +8) 33,001 lb and over 5.5 5.7 5.7 +8 +Light truck subtotal (1–2) +15.7 +15.8 +16.2 + + +9 +Medium truck subtotal (3–6) +7.3 +8.6 +8.0 + + 10 -Large truck subtotal +Large truck subtotal (7–8) 5.6 6.1 5.8 @@ -4764,20 +5011,53 @@

Fuel Economy by

-

Table 10.4: Retail Prices for Motor Fuel, 1978–2012 (cents per gallon, including tax)

-
-
# Read Excel file directly from URL
-df_FE_SizeClass_2 = pd.read_excel(
-  "archive-v9.0\\1 - Auto Operating Cost - 2022-01-11.xlsx", # File path
-  sheet_name="Fuel Economy by Size Class",
-  usecols="A:C", # TODO: update cols later for new data
-  header=35,
-  nrows=1
-)
-
-# display the data
-df_FE_SizeClass_2
-
+

Table 11.6: (Updated June 2022) Retail Prices for Motor Fuel, 1978–2021 (dollars per gallon, including tax)

+
+
+Show the code +
# Read Table 11.6 in Page 285
+df_FE_SizeClass_2 = pd.DataFrame({
+    "Year": [
+        1978, 1980, 1985, 1990, 1995, 1996, 1997, 1998, 1999, 2000,
+        2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+        2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021
+    ],
+    "Diesel_Current": [
+        None, 1.01, 1.22, 1.07, 1.11, 1.24, 1.20, 1.04, 1.12, 1.49,
+        1.40, 1.32, 1.51, 1.81, 2.40, 2.71, 2.89, 3.80, 2.47, 2.99,
+        3.84, 3.97, 3.92, 3.83, 2.71, 2.30, 2.65, 3.18, 3.06, 2.55, 3.29
+    ],
+    "Diesel_Constant_2021": [
+        None, 3.32, 3.07, 2.22, 1.97, 2.13, 2.02, 1.74, 1.82, 2.35,
+        2.14, 1.99, 2.22, 2.60, 3.33, 3.64, 3.77, 4.79, 3.12, 3.72,
+        4.63, 4.68, 4.56, 4.38, 3.09, 2.60, 2.93, 3.43, 3.24, 2.67, 3.29
+    ],
+    "Regular_Current": [
+        0.67, 1.25, 1.20, 1.16, 1.15, 1.23, 1.23, 1.06, 1.17, 1.51,
+        1.46, 1.36, 1.59, 1.88, 2.30, 2.59, 2.80, 3.27, 2.35, 2.79,
+        3.53, 3.64, 3.53, 3.37, 2.45, 2.14, 2.41, 2.74, 2.64, 2.17, 3.05
+    ],
+    "Regular_Constant_2021": [
+        2.78, 4.09, 3.03, 2.41, 2.04, 2.13, 2.08, 1.76, 1.89, 2.38,
+        2.24, 2.05, 2.34, 2.70, 3.18, 3.48, 3.66, 4.11, 2.97, 3.46,
+        4.25, 4.30, 4.10, 3.85, 2.80, 2.42, 2.66, 2.95, 2.79, 2.28, 3.05
+    ],
+    "Premium_Current": [
+        None, None, 1.34, 1.35, 1.34, 1.41, 1.42, 1.25, 1.36, 1.69,
+        1.66, 1.56, 1.78, 2.07, 2.49, 2.81, 3.03, 3.52, 2.61, 3.05,
+        3.79, 3.92, 3.84, 3.71, 2.87, 2.61, 2.91, 3.27, 3.21, 2.79, 3.69
+    ],
+    "Premium_Constant_2021": [
+        None, None, 3.37, 2.80, 2.38, 2.44, 2.39, 2.08, 2.21, 2.66,
+        2.54, 2.34, 2.62, 2.97, 3.46, 3.77, 3.96, 4.43, 3.29, 3.79,
+        4.57, 4.63, 4.47, 4.25, 3.28, 2.95, 3.22, 3.53, 3.40, 2.92, 3.69
+    ]
+})
+
+# display the data
+df_FE_SizeClass_2
+
+
@@ -4786,63 +5066,377 @@

Fuel Economy by Year -Diesel fuel -Average for all gasoline types +Diesel_Current +Diesel_Constant_2021 +Regular_Current +Regular_Constant_2021 +Premium_Current +Premium_Constant_2021 0 -2012 -397 -370 +1978 +NaN +NaN +0.67 +2.78 +NaN +NaN - - - -

-
-
-
-
# FIXME: Unsure the logic behind this calculation.
-df_FE_SizeClass_2["Something"] = df_FE_SizeClass_2["Diesel fuel"]/df_FE_SizeClass_2["Average for all gasoline types"]
-
-df_FE_SizeClass_2["Something"]
-
-
0    1.072973
-Name: Something, dtype: float64
-
-
-
-
-

Repair and Maintenance Cost - Heavy

-
-
-

-
Repair and Maintenance Cost per Mile
-
-
-

Source: https://www.truckinginfo.com/10150350/2021-hdt-fact-book-maintenance-costs-expected-to-rise

-

Further Research: American Transportation Research Institute

-
-
# Manually Entering the data from above image
-df_RepairMaintenanceCost_Heavy = pd.DataFrame({
-    "Year": ["2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019"],
-    "CostMile": [0.124, 0.152, 0.138, 0.148, 0.158, 0.156, 0.166, 0.167, 0.171, 0.14]
-})
-
-# display the data
-df_RepairMaintenanceCost_Heavy
-
-
- - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
YearCostMile
119801.013.321.254.09NaNNaN
219851.223.071.203.031.343.37
319901.072.221.162.411.352.80
419951.111.971.152.041.342.38
519961.242.131.232.131.412.44
619971.202.021.232.081.422.39
719981.041.741.061.761.252.08
819991.121.821.171.891.362.21
920001.492.351.512.381.692.66
1020011.402.141.462.241.662.54
1120021.321.991.362.051.562.34
1220031.512.221.592.341.782.62
1320041.812.601.882.702.072.97
1420052.403.332.303.182.493.46
1520062.713.642.593.482.813.77
1620072.893.772.803.663.033.96
1720083.804.793.274.113.524.43
1820092.473.122.352.972.613.29
1920102.993.722.793.463.053.79
2020113.844.633.534.253.794.57
2120123.974.683.644.303.924.63
2220133.924.563.534.103.844.47
2320143.834.383.373.853.714.25
2420152.713.092.452.802.873.28
2520162.302.602.142.422.612.95
2620172.652.932.412.662.913.22
2720183.183.432.742.953.273.53
2820193.063.242.642.793.213.40
2920202.552.672.172.282.792.92
3020213.293.293.053.053.693.69
+ +
+
+
+
+
+Show the code +
# FIXME: Unsure the logic behind this calculation.
+df_FE_SizeClass_2["Diesel to Average Ratio"] = df_FE_SizeClass_2["Diesel_Current"] / (df_FE_SizeClass_2["Regular_Current"] + df_FE_SizeClass_2["Premium_Current"]) / 2
+
+df_FE_SizeClass_2.loc[df_FE_SizeClass_2['Year'] == 2021, 'Diesel to Average Ratio']
+
+
+
30    0.244065
+Name: Diesel to Average Ratio, dtype: float64
+
+
+
+
+

Repair and Maintenance Cost - Heavy

+
+
+

+
Repair and Maintenance Cost per Mile
+
+
+

Source: https://www.truckinginfo.com/10150350/2021-hdt-fact-book-maintenance-costs-expected-to-rise

+

Further Research: American Transportation Research Institute

+
+
+Show the code +
# Manually Entering the data from above image
+df_RepairMaintenanceCost_Heavy = pd.DataFrame({
+    "Year": ["2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019"],
+    "CostMile": [0.124, 0.152, 0.138, 0.148, 0.158, 0.156, 0.166, 0.167, 0.171, 0.14]
+})
+
+# display the data
+df_RepairMaintenanceCost_Heavy
+
+
+
+ + + + + + + + @@ -4906,34 +5500,50 @@

Repair

Driving Costs

Data Source: https://exchange.aaa.com/wp-content/uploads/2019/09/AAA-Your-Driving-Costs-2019.pdf

-
-
# Read Excel file directly from URL
-df_DrivingCosts = pd.read_excel(
-  "archive-v9.0\\1 - Auto Operating Cost - 2022-01-11.xlsx", # File path
-  sheet_name="Driving Costs",
-  usecols="A:K", # TODO: update cols later for new data
-  skiprows=3,     # Skip the first 3 rows
-  nrows=31
-)
-
-# Manually set column names
-df_DrivingCosts.columns = [
-    "Cost Categories",
-    "Small Sedan",
-    "Medium Sedan",
-    "Large Sedan",
-    "Small SUV (FWD)",
-    "Medium SUV (FWD)",
-    "Minivan",
-    "1/2 Ton/Crew Pickup (4WD)",
-    "Hybrid Vehicle",
-    "Electric Vehicle",
-    "2020 Weighted Average"
-]
-
-# display the data
-df_DrivingCosts
-
+
+
+Show the code +
# Ensure file exists
+filepath_drivingcost = Path("data/aaa/YDC-Brochure_2023-FINAL-8.30.23-.pdf")
+if not filepath_drivingcost.exists():
+    filepath_drivingcost.parent.mkdir(parents=True, exist_ok=True)
+    response = requests.get("https://newsroom.aaa.com/wp-content/uploads/2023/08/YDC-Brochure_2023-FINAL-8.30.23-.pdf")
+    filepath_drivingcost.write_bytes(response.content)
+
+
+
+
+Show the code +
with pdfplumber.open(filepath_drivingcost) as pdf:
+    # Page 1 (index 0)
+    page1 = pdf.pages[0]
+
+    # Page 2 (index 1)
+    page2 = pdf.pages[1]
+
+    # Use lines strategy for table detection
+    table_settings = {
+        "vertical_strategy": "lines",
+        "horizontal_strategy": "lines",
+    }
+
+    # Extract tables from both pages
+    table1 = page1.extract_table(table_settings=table_settings)
+    table2 = page2.extract_table(table_settings=table_settings)
+
+    # Create DataFrames
+    df_page1 = pd.DataFrame(table1[1:], columns=table1[0])
+    df_page2 = pd.DataFrame(table2[1:], columns=table2[0])
+
+    # Remove the 6th column (index 5) from df_page2
+    df_page2_clean = df_page2.drop(df_page2.columns[0], axis=1)
+
+    # Concatenate horizontally (side by side)
+    df_DrivingCosts = pd.concat([df_page1, df_page2_clean], axis=1)
+
+df_DrivingCosts
+
+
@@ -4941,439 +5551,453 @@

Driving Costs

- - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + +
YearCostMile
Cost CategoriesSmall SedanMedium SedanLarge SedanSmall SUV (FWD)Medium SUV (FWD)Minivan1/2 Ton/Crew Pickup (4WD)Hybrid VehicleElectric Vehicle2020 Weighted AverageSmall\nSedanMedium\nSedanSubcompact\nSUVCompact\nSUV (FWD)Medium\nSUV (4WD)Midsize\nPickup1/2 Ton/Crew-\nCab PickupHybrid\nVehicleElectric\nVehicle2023 Weighted\nAverage
0fuel8.36009.270012.77009.420013.200012.610015.67005.76003.650011.6000Operating CostsNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
1maintenance8.53009.18009.49009.09009.60008.73008.77007.70006.60008.9400fuel11.18¢12.52¢13.17¢12.76¢16.66¢19.05¢22.31¢9.58¢4.74¢15.93¢
2cost per mile16.890018.450022.260018.510022.800021.340024.440013.460010.250020.5400maintenance9.11¢10.85¢9.51¢10.39¢10.57¢10.35¢9.42¢9.09¢8.12¢9.83¢
3Ownership CostsNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNcost per mile20.29¢23.37¢22.68¢23.14¢27.22¢29.40¢31.73¢18.67¢12.86¢25.76¢
4full-coverage insurance1328.00001251.00001221.00001089.00001114.00001103.00001236.00001202.00001203.00001194.0000Ownership CostsNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
5license, registration, taxes466.0000661.0000807.0000630.0000862.0000769.00001013.0000639.0000-519.0000753.0000full-coverage insurance$1,794$1,922$1,713$1,681$1,685$1,679$1,807$1,710$1,820$1,765
6depreciation (15k mi/yr)2240.00003169.00004061.00003132.00003794.00004036.00003696.00003087.00005250.00003334.0000license, registration, taxes$505$668$599$629$816$825$1,099$692-$192$762
7finance546.0000794.0000975.0000766.00001075.0000927.00001228.0000789.0000848.0000920.0000depreciation (15k mi/yr)$2,846$3,922$3,102$3,332$4,136$4,089$6,464$3,401$5,296$4,538
8cost per year4580.00005875.00007064.00005617.00006845.00006835.00007173.00005717.00006782.00006201.0000finance charges$750$1,030$901$953$1,250$1,255$1,729$1,046$1,260$1,253
9cost per day12.550016.100019.350015.390018.750018.730019.650015.660018.580016.9900cost per year$5,895$7,542$6,316$6,594$7,887$7,848$11,099$6,849$8,183$8,318
10Total Cost per Mile - 10k mi/yrNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNcost per day$16.15$20.66$17.30$18.07$21.61$21.50$30.41$18.76$22.42$22.79
11cost per mile driven1689.00001845.00002226.00001851.00002280.00002134.00002444.00001346.00001025.00002054.0000Total Cost – 10k mi/yrNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
12cost per year4580.00005875.00007064.00005617.00006845.00006835.00007173.00005717.00006782.00006201.0000operating cost$2,029$2,337$2,268$2,314$2,722$2,940$3,173$1,867$1,286$2,576
13depreciation-209.0000-233.0000-296.0000-286.0000-382.0000-264.0000-454.0000-264.0000-312.0000-326.0000ownership cost$5,895$7,542$6,316$6,594$7,887$7,848$11,099$6,849$8,183$8,318
14total cost per year6060.00007487.00008994.00007182.00008743.00008705.00009163.00006799.00007495.00007929.0000depreciation1-$217-$241-2$33-$286-$371-$395-$453-$272-$370-$345
15cost per day16.600020.510024.640019.680023.950023.850025.100018.630020.530021.7200total cost per year$7,707$9,638$8,351$8,623$10,239$10,393$13,818$8,445$9,099$10,549
16cost per mile0.60600.74870.89940.71820.87430.87050.91630.67990.74950.7929total cost per day$21.12$26.41$22.88$23.62$28.05$28.48$37.86$23.14$24.93$28.90
17Total Cost per Mile - 15k mi/yrNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNtotal cost per mile2$0.7707$0.9638$0.8351$0.8623$1.0239$1.0393$1.3818$0.8445$0.9099$1.0549
18cost per mile driven2534.00002768.00003339.00002777.00003420.00003201.00003666.00002019.00001538.00003081.0000Total Cost – 15k mi/yrNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
19cost per year4580.00005875.00007064.00005617.00006845.00006835.00007173.00005717.00006782.00006201.0000operating cost$3,044$3,505$3,402$3,471$4,084$4,410$4,759$2,801$1,929$3,864
20total cost per year7114.00008643.000010403.00008394.000010265.000010036.000010839.00007736.00008320.00009282.0000ownership cost$5,895$7,542$6,316$6,594$7,887$7,848$11,099$6,849$8,183$8,318
21total cost per day19.490023.680028.500023.000028.120027.500029.700021.190022.790025.4300total cost per year$8,939$11,048$9,718$10,066$11,971$12,258$15,858$9,650$10,112$12,182
22total cost per mile0.47420.57620.69350.55960.68430.66910.72260.51570.55460.6188total cost per day$24.49$30.27$26.62$27.58$32.80$33.58$43.45$26.44$27.70$33.37
23Total Cost per Mile - 20k mi/yrNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNtotal cost per mile2$0.5959$0.7365$0.6479$0.6710$0.7981$0.8172$1.0572$0.6433$0.6741$0.8121
24cost per mile driven3378.00003690.00004452.00003702.00004560.00004268.00004888.00002692.00002050.00004108.0000Total Cost – 20k mi/yrNoneNoneNoneNoneNoneNoneNoneNoneNoneNone
25cost per year4580.00005875.00007064.00005617.00006845.00006835.00007173.00005717.00006782.00006201.0000operating cost$4,058$4,674$4,537$4,628$5,445$5,879$6,346$3,734$2,572$5,152
26depreciation227.0000252.0000320.0000310.0000414.0000286.0000496.0000285.0000338.0000354.0000ownership cost$5,895$7,542$6,316$6,594$7,887$7,848$11,099$6,849$8,183$8,318
27total cost per year8185.00009817.000011836.00009629.000011819.000011389.000012557.00008694.00009170.000010663.0000depreciation1+$235+$261+$252+$311+$401+$428+$496+$294+$399+$375
28cost per day22.420026.900032.430026.380032.380031.200034.400023.820025.120029.2100total cost per year$10,188$12,477$11,104$11,533$13,733$14,156$17,940$10,877$11,154$13,844
29cost per mile0.40930.49090.59180.48150.59100.56950.62790.43470.45850.5331total cost per day$27.91$34.18$30.42$31.60$37.63$38.78$49.15$29.80$30.56$37.93
30total cost per mile2$0.5094$0.6239$0.5552$0.5767$0.6867$0.7078$0.8970$0.5438$0.5577$0.6922
@@ -5389,35 +6013,38 @@

Transportation Expenditures

Create Dataframe

-
-
# Define year range
-year_range = list(range(1990, 2021)) # Last year should be one more than desired
-
-# Ensure column names are strings in both DataFrames to avoid indexing issues
-df_PersonalExpenditure.columns = df_PersonalExpenditure.columns.astype(str)
-df_AverageCost.columns = df_AverageCost.columns.astype(str)
-
-# Create a DataFrame to combine the extracted data
-df_TransportationExpenditure = pd.DataFrame({
-    # The years from 1990 to 2020
-    "Year": year_range,
-    # Extract the 'Transportation Cost Percent of Total' for the years 1990-2020 from row 2
-    "Transportation Percent of Total": pd.to_numeric(
-      df_PersonalExpenditure.loc[2, str(year_range[0]):str(year_range[-1])].values,
-      errors="coerce"
-    ),
-    # Extract the 'Gasoline Cost of Transportation' for the years 1990-2020 from row 2
-    "Gasoline Cost of Transportation": pd.to_numeric(
-      df_AverageCost.loc[2, str(year_range[0]):str(year_range[-1])].values,
-      errors="coerce"
-    )
-})
-
-# FIXME: Did not understand the logic for this
-df_TransportationExpenditure["Gasoline Percent of Total"] = df_TransportationExpenditure["Gasoline Cost of Transportation"] * df_TransportationExpenditure["Transportation Percent of Total"] / 100
-
-df_TransportationExpenditure
-
+
+
+Show the code +
# Define year range
+year_range = list(range(1990, BASE_YEAR+1)) # Last year should be one more than desired
+
+# Ensure column names are strings in both DataFrames to avoid indexing issues
+df_PersonalExpenditure.columns = df_PersonalExpenditure.columns.astype(str)
+df_AverageCost.columns = df_AverageCost.columns.astype(str)
+
+# Create a DataFrame to combine the extracted data
+df_TransportationExpenditure = pd.DataFrame({
+    # The years from 1990 to 2024
+    "Year": year_range,
+    # Extract the 'Transportation Cost Percent of Total' for the years 1990-2020 from row 2
+    "Transportation Percent of Total": pd.to_numeric(
+      df_PersonalExpenditure.loc[2, str(year_range[0]):str(year_range[-1])].values,
+      errors="coerce"
+    ),
+    # Extract the 'Gasoline Cost of Transportation' for the years 1990-2020 from row 2
+    "Gasoline Cost of Transportation": pd.to_numeric(
+      df_AverageCost.loc[2, str(year_range[0]):str(year_range[-1])].values,
+      errors="coerce"
+    )
+})
+
+# FIXME: Did not understand the logic for this
+df_TransportationExpenditure["Gasoline Percent of Total"] = df_TransportationExpenditure["Gasoline Cost of Transportation"] * df_TransportationExpenditure["Transportation Percent of Total"] / 100
+
+df_TransportationExpenditure
+
+
@@ -5596,58 +6223,79 @@

Create Dataframe

23 2013 -10.300199 +10.343009 23.761237 -2.447455 +2.457627 24 2014 -10.145703 +10.252500 21.969356 -2.228946 +2.252408 25 2015 -9.489218 +9.608741 19.332030 -1.834459 +1.857565 26 2016 -9.163512 +9.305556 14.810703 -1.357181 +1.378218 27 2017 -9.315180 +9.490290 18.174303 -1.692969 +1.724794 28 2018 -9.467568 +9.674862 18.730930 -1.773364 +1.812192 29 2019 -9.193706 +9.419574 18.745960 -1.723448 +1.765790 30 2020 -8.068630 +8.095043 16.724192 -1.349413 +1.353830 + + +31 +2021 +9.470232 +16.635630 +1.575433 + + +32 +2022 +10.060336 +25.151459 +2.530321 + + +33 +2023 +9.595676 +19.615006 +1.882192 @@ -5658,51 +6306,54 @@

Create Dataframe

Actual vs Trend Comparision

-
-
# Create the comparison DataFrame
-df_TranspExp_Comparision = pd.DataFrame({
-    'Date': [2019, 2019],
-    'Actual': [
-        df_TransportationExpenditure.loc[df_TransportationExpenditure['Year'] == 2019, 'Transportation Percent of Total'].iloc[0],
-        df_TransportationExpenditure.loc[df_TransportationExpenditure['Year'] == 2019, 'Gasoline Percent of Total'].iloc[0]  # FIXED: THere is a potential error here in Excel sheet
-    ],
-    'Trend': [
-        np.poly1d(np.polyfit(pd.to_numeric(df_TransportationExpenditure['Year']),
-                            pd.to_numeric(df_TransportationExpenditure['Transportation Percent of Total']), 1))(2019),
-        np.poly1d(np.polyfit(pd.to_numeric(df_TransportationExpenditure['Year']),
-                            pd.to_numeric(df_TransportationExpenditure['Gasoline Percent of Total']), 1))(2019)
-    ]
-}, index=['Transportation as % Total Expenditures', 'Gasoline as % Total Expenditures']).round(2)
-
-df_TranspExp_Comparision
-
+
+
+Show the code +
# Create the comparison DataFrame
+df_TranspExp_Comparision = pd.DataFrame({
+    'Date': [BASE_YEAR, BASE_YEAR],
+    'Actual': [
+        df_TransportationExpenditure.loc[df_TransportationExpenditure['Year'] == BASE_YEAR, 'Transportation Percent of Total'].iloc[0],
+        df_TransportationExpenditure.loc[df_TransportationExpenditure['Year'] == BASE_YEAR, 'Gasoline Percent of Total'].iloc[0]  # FIXED: THere is a potential error here in Excel sheet
+    ],
+    'Trend': [
+        np.poly1d(np.polyfit(pd.to_numeric(df_TransportationExpenditure['Year']),
+                            pd.to_numeric(df_TransportationExpenditure['Transportation Percent of Total']), 1))(BASE_YEAR),
+        np.poly1d(np.polyfit(pd.to_numeric(df_TransportationExpenditure['Year']),
+                            pd.to_numeric(df_TransportationExpenditure['Gasoline Percent of Total']), 1))(BASE_YEAR)
+    ]
+}, index=['Transportation as % Total Expenditures', 'Gasoline as % Total Expenditures']).round(2)
+
+df_TranspExp_Comparision
+
+
@@ -5743,15 +6397,15 @@

Actual vs Tren Transportation as % Total Expenditures -2019 -9.19 -9.26 +2023 +9.60 +9.24 Gasoline as % Total Expenditures -2019 -1.72 -1.85 +2023 +1.88 +1.94 @@ -5765,42 +6419,45 @@

Actual vs Tren

Auto Cost - Variable-Fixed

Create Dataframe

-
-
# Define year range
-year_range = list(range(1990, 2021))  # Last year should be one more than desired
-
-# Compile data from Raw Datasets
-df_AutoCost_VariableFixed = pd.DataFrame({
-    "Year": year_range,
-    "Variable": pd.to_numeric(
-      df_AverageCost.loc[6, str(year_range[0]):str(year_range[-1])].values,
-      errors="coerce"
-    ),
-    "Fixed": pd.to_numeric(
-      df_AverageCost.loc[7, str(year_range[0]):str(year_range[-1])].values,
-      errors="coerce"
-    ),
-    "Total": pd.to_numeric(
-      df_AverageCost.loc[5, str(year_range[0]):str(year_range[-1])].values,
-      errors="coerce"
-    ),
-    "CPI": pd.to_numeric(
-      df_CPI[df_CPI['Year'].between(year_range[0], year_range[-1])]["Avg."].values,
-      errors="coerce"
-    )
-})
-
-# Create Derived Columns
-df_AutoCost_VariableFixed["Per 15k"] = df_AutoCost_VariableFixed["Fixed"] / 15000
-df_AutoCost_VariableFixed["Variable/Total"] = df_AutoCost_VariableFixed["Variable"] / df_AutoCost_VariableFixed["Total"]
-df_AutoCost_VariableFixed["Variable/CPI"] = df_AutoCost_VariableFixed["Variable"] / df_AutoCost_VariableFixed["CPI"]
-df_AutoCost_VariableFixed["Fixed/CPI"] = df_AutoCost_VariableFixed["Fixed"] / df_AutoCost_VariableFixed["CPI"]
-
-# Reorder columns
-df_AutoCost_VariableFixed = df_AutoCost_VariableFixed[['Year', 'Variable/Total', 'Variable/CPI', 'Fixed/CPI', 'Variable', 'Fixed', 'Total', 'Per 15k', 'CPI']]
-
-df_AutoCost_VariableFixed
-
+
+
+Show the code +
# Define year range
+year_range = list(range(1990, BASE_YEAR+1))  # Last year should be one more than desired
+
+# Compile data from Raw Datasets
+df_AutoCost_VariableFixed = pd.DataFrame({
+    "Year": year_range,
+    "Variable": pd.to_numeric(
+      df_AverageCost.loc[6, str(year_range[0]):str(year_range[-1])].values,
+      errors="coerce"
+    ),
+    "Fixed": pd.to_numeric(
+      df_AverageCost.loc[7, str(year_range[0]):str(year_range[-1])].values,
+      errors="coerce"
+    ),
+    "Total": pd.to_numeric(
+      df_AverageCost.loc[5, str(year_range[0]):str(year_range[-1])].values,
+      errors="coerce"
+    ),
+    "CPI": pd.to_numeric(
+      df_CPI[df_CPI['year'].between(year_range[0], year_range[-1])]["annualaverage"].values,
+      errors="coerce"
+    )
+})
+
+# Create Derived Columns
+df_AutoCost_VariableFixed["Per 15k"] = df_AutoCost_VariableFixed["Fixed"] / 15000
+df_AutoCost_VariableFixed["Variable/Total"] = df_AutoCost_VariableFixed["Variable"] / df_AutoCost_VariableFixed["Total"]
+df_AutoCost_VariableFixed["Variable/CPI"] = df_AutoCost_VariableFixed["Variable"] / df_AutoCost_VariableFixed["CPI"]
+df_AutoCost_VariableFixed["Fixed/CPI"] = df_AutoCost_VariableFixed["Fixed"] / df_AutoCost_VariableFixed["CPI"]
+
+# Reorder columns
+df_AutoCost_VariableFixed = df_AutoCost_VariableFixed[['Year', 'Variable/Total', 'Variable/CPI', 'Fixed/CPI', 'Variable', 'Fixed', 'Total', 'Per 15k', 'CPI']]
+
+df_AutoCost_VariableFixed
+
+
@@ -5824,121 +6481,121 @@

Create Dataframe

0 1990 0.254340 -9.640398 -28.263198 +9.643472 +28.272211 1260.0 3694.0 4954.0 0.246267 -130.700 +130.658333 1 1991 0.259775 -10.682819 -30.440529 +10.683473 +30.442391 1455.0 4146.0 5601.0 0.276400 -136.200 +136.191667 2 1992 0.231799 -9.622238 -31.888810 +9.621095 +31.885022 1350.0 4474.0 5824.0 0.298267 -140.300 +140.316667 3 1993 0.237767 -9.550173 -30.615917 +9.552928 +30.624748 1380.0 4424.0 5804.0 0.294933 -144.500 +144.458333 4 1994 0.230730 -9.210526 -30.708502 +9.208973 +30.703323 1365.0 4551.0 5916.0 0.303400 -148.200 +148.225000 5 1995 0.232821 -9.448819 -31.135171 +9.449852 +31.138576 1440.0 4745.0 6185.0 0.316333 -152.400 +152.383333 6 1996 0.225387 -9.177820 -31.542384 +9.180746 +31.552439 1440.0 4949.0 6389.0 0.329933 -156.900 +156.850000 7 1997 0.240964 -10.093458 -31.794393 +10.092410 +31.791091 1620.0 5103.0 6723.0 0.340200 -160.500 +160.516667 8 1998 0.232339 -9.846626 -32.533742 +9.846122 +32.532079 1605.0 5303.0 6908.0 0.353533 -163.000 +163.008333 9 1999 0.225532 -9.543818 -32.773109 +9.545250 +32.778028 1590.0 5460.0 7050.0 0.364000 -166.600 +166.575000 10 @@ -5950,103 +6607,103 @@

Create Dataframe

5534.0 7363.0 0.368933 -172.200 +172.200000 11 2001 0.266527 -11.518916 -31.699605 +11.521084 +31.705572 2040.0 5614.0 7654.0 0.374267 -177.100 +177.066667 12 2002 0.234935 -9.838799 -32.040022 +9.840167 +32.044475 1770.0 5764.0 7534.0 0.384267 -179.900 +179.875000 13 2003 0.253418 -10.679348 -31.461957 +10.681767 +31.469083 1965.0 5789.0 7754.0 0.385933 -184.000 +183.958333 14 2004 0.224173 -10.005294 -34.626787 +10.006177 +34.629842 1890.0 6541.0 8431.0 0.436067 -188.900 +188.883333 15 2005 0.251486 -10.829493 -32.232463 +10.829955 +32.233838 2115.0 6295.0 8410.0 0.419667 -195.300 +195.291667 16 2006 0.289124 -11.235119 -27.624008 +11.235583 +27.625150 2265.0 5569.0 7834.0 0.371267 -201.600 +201.591667 17 2007 0.278026 -10.489915 -27.240019 +10.489894 +27.239964 2175.0 5648.0 7823.0 0.376533 -207.342 +207.342417 18 2008 0.313385 -11.820551 -25.898385 +11.820578 +25.898445 2545.0 5576.0 8121.0 0.371733 -215.303 +215.302500 19 @@ -6058,67 +6715,67 @@

Create Dataframe

5783.0 8096.0 0.385533 -214.537 +214.537000 20 2010 0.295864 -11.515391 -27.405804 +11.515417 +27.405867 2511.0 5976.0 8487.0 0.398400 -218.056 +218.055500 21 2011 0.303327 -11.834320 -27.180702 +11.834311 +27.180682 2662.0 6114.0 8776.0 0.407600 -224.939 +224.939167 22 2012 0.329309 -12.831346 -26.133087 +12.831350 +26.133097 2946.0 6000.0 8946.0 0.400000 -229.594 +229.593917 23 2013 0.335891 -13.152642 -26.004799 +13.152637 +26.004790 3064.0 6058.0 9122.0 0.403867 -232.957 +232.957083 24 2014 0.321654 -12.059847 -25.433394 +12.059839 +25.433376 2855.0 6021.0 8876.0 0.401400 -236.736 +236.736167 25 @@ -6130,67 +6787,103 @@

Create Dataframe

6102.0 8698.0 0.406800 -237.017 +237.017000 26 2016 0.258004 -9.199732 -26.457562 +9.199725 +26.457543 2208.0 6350.0 8558.0 0.423333 -240.007 +240.007167 27 2017 0.321918 -11.121084 -23.425261 +11.121102 +23.425301 2726.0 5742.0 8468.0 0.382800 -245.120 +245.119583 28 2018 0.326478 -11.505056 -23.734902 +11.505063 +23.734918 2889.0 5960.0 8849.0 0.397333 -251.107 +251.106833 29 2019 0.331933 -12.051303 -24.255154 +12.051283 +24.255115 3081.0 6201.0 9282.0 0.413400 -255.657 +255.657417 30 2020 0.310428 -11.467828 -25.474188 +11.467820 +25.474171 2968.0 6593.0 9561.0 0.439533 -258.811 +258.811167 + + +31 +2021 +0.314711 +11.226345 +24.445533 +3042.0 +6624.0 +9666.0 +0.441600 +270.969750 + + +32 +2022 +0.386895 +14.183941 +22.476984 +4151.0 +6578.0 +10729.0 +0.438533 +292.654917 + + +33 +2023 +0.317189 +12.681260 +27.298841 +3864.0 +8318.0 +12182.0 +0.554533 +304.701583 @@ -6203,54 +6896,57 @@

Create Dataframe

Plotting Trends

Fixed/CPI and Variable/CPI
-
-
# Plotting the data using Seaborn and Matplotlib
-plt.figure(figsize=(10, 6))
-
-# Create smooth spline curves
-x = df_AutoCost_VariableFixed['Year']
-y_fixed = df_AutoCost_VariableFixed['Fixed/CPI']
-y_variable = df_AutoCost_VariableFixed['Variable/CPI']
-
-# Generate smooth curves
-x_smooth = np.linspace(x.min(), x.max(), 300)
-spline_fixed = make_interp_spline(x, y_fixed, k=3)
-spline_variable = make_interp_spline(x, y_variable, k=3)
-
-y_fixed_smooth = spline_fixed(x_smooth)
-y_variable_smooth = spline_variable(x_smooth)
-
-# Plot smooth lines
-sns.lineplot(x=x_smooth, y=y_fixed_smooth, linewidth=2.5, color="#00B050", label="Fixed/CPI")
-sns.lineplot(x=x_smooth, y=y_variable_smooth, linewidth=2.5, color="#FF0000", label="Variable/CPI")
-
-# Format y-axis as currency with comma separation using anonymous function
-plt.gca().yaxis.set_major_formatter(FuncFormatter(lambda x, p: f'${x:,.0f}'))
-
-# Customize the plot
-plt.title('Trendline of Fixed/CPI and Variable/CPI (1990–2020)',
-          fontsize=16, fontweight='bold', pad=20)
-plt.xlabel('Year', fontsize=13)
-plt.ylabel('Value', fontsize=13)
-
-# Show all x-axis labels with 90-degree rotation
-plt.xticks(df_AutoCost_VariableFixed['Year'], rotation=90)
-
-plt.legend(loc='upper right', fontsize=11)
-
-# Set y-axis limits to extend to $40
-plt.ylim(0, 40)
-
-# Add major and minor grid lines for better readability
-plt.grid(True, alpha=0.3, linestyle='-', linewidth=0.5, which='major')
-
-# Improve layout
-plt.tight_layout()
-plt.show()
+
+
+Show the code +
# Plotting the data using Seaborn and Matplotlib
+plt.figure(figsize=(10, 6))
+
+# Create smooth spline curves
+x = df_AutoCost_VariableFixed['Year']
+y_fixed = df_AutoCost_VariableFixed['Fixed/CPI']
+y_variable = df_AutoCost_VariableFixed['Variable/CPI']
+
+# Generate smooth curves
+x_smooth = np.linspace(x.min(), x.max(), 300)
+spline_fixed = make_interp_spline(x, y_fixed, k=3)
+spline_variable = make_interp_spline(x, y_variable, k=3)
+
+y_fixed_smooth = spline_fixed(x_smooth)
+y_variable_smooth = spline_variable(x_smooth)
+
+# Plot smooth lines
+sns.lineplot(x=x_smooth, y=y_fixed_smooth, linewidth=2.5, color="#00B050", label="Fixed/CPI")
+sns.lineplot(x=x_smooth, y=y_variable_smooth, linewidth=2.5, color="#FF0000", label="Variable/CPI")
+
+# Format y-axis as currency with comma separation using anonymous function
+plt.gca().yaxis.set_major_formatter(FuncFormatter(lambda x, p: f'${x:,.0f}'))
+
+# Customize the plot
+plt.title('Trendline of Fixed/CPI and Variable/CPI (1990–2020)',
+          fontsize=16, fontweight='bold', pad=20)
+plt.xlabel('Year', fontsize=13)
+plt.ylabel('Value', fontsize=13)
+
+# Show all x-axis labels with 90-degree rotation
+plt.xticks(df_AutoCost_VariableFixed['Year'], rotation=90)
+
+plt.legend(loc='upper right', fontsize=11)
+
+# Set y-axis limits to extend to $40
+plt.ylim(0, 40)
+
+# Add major and minor grid lines for better readability
+plt.grid(True, alpha=0.3, linestyle='-', linewidth=0.5, which='major')
+
+# Improve layout
+plt.tight_layout()
+plt.show()
+
-

+

@@ -6258,50 +6954,53 @@
Fixed/CPI and Var
Average Cost per Mile
-
-
# Create the stacked area plot
-plt.figure(figsize=(10, 6))
-
-# Stack the areas - Fixed on bottom, Variable on top
-plt.fill_between(df_AutoCost_VariableFixed['Year'],
-                 0,
-                 df_AutoCost_VariableFixed['Fixed'],
-                 color='#9BBB59',
-                 label='Fixed')
-
-plt.fill_between(df_AutoCost_VariableFixed['Year'],
-                 df_AutoCost_VariableFixed['Fixed'],
-                 df_AutoCost_VariableFixed['Fixed'] + df_AutoCost_VariableFixed['Variable'],
-                 color='#C0504D',
-                 label='Variable')
-
-# Format y-axis as currency with comma separation using anonymous function
-plt.gca().yaxis.set_major_formatter(FuncFormatter(lambda x, p: f'${x:,.0f}'))
-
-# Customize the plot
-plt.title('Average Total Cost per 15,000 Miles',
-          fontsize=16, fontweight='bold', pad=20)
-plt.xlabel('Year', fontsize=13)
-plt.ylabel('USDs', fontsize=13)
-
-# Show all x-axis labels with 90-degree rotation
-plt.xticks(df_AutoCost_VariableFixed['Year'], rotation=90)
-
-plt.legend(loc='upper left', fontsize=11)
-
-# Set y-axis limits
-plt.ylim(0, 10000)
-
-# Add grid
-plt.grid(True, alpha=0.3, linestyle='-', linewidth=0.5, which='major')
-
-# Improve layout
-plt.tight_layout()
-plt.show()
+
+
+Show the code +
# Create the stacked area plot
+plt.figure(figsize=(10, 6))
+
+# Stack the areas - Fixed on bottom, Variable on top
+plt.fill_between(df_AutoCost_VariableFixed['Year'],
+                 0,
+                 df_AutoCost_VariableFixed['Fixed'],
+                 color='#9BBB59',
+                 label='Fixed')
+
+plt.fill_between(df_AutoCost_VariableFixed['Year'],
+                 df_AutoCost_VariableFixed['Fixed'],
+                 df_AutoCost_VariableFixed['Fixed'] + df_AutoCost_VariableFixed['Variable'],
+                 color='#C0504D',
+                 label='Variable')
+
+# Format y-axis as currency with comma separation using anonymous function
+plt.gca().yaxis.set_major_formatter(FuncFormatter(lambda x, p: f'${x:,.0f}'))
+
+# Customize the plot
+plt.title('Average Total Cost per 15,000 Miles',
+          fontsize=16, fontweight='bold', pad=20)
+plt.xlabel('Year', fontsize=13)
+plt.ylabel('USDs', fontsize=13)
+
+# Show all x-axis labels with 90-degree rotation
+plt.xticks(df_AutoCost_VariableFixed['Year'], rotation=90)
+
+plt.legend(loc='upper left', fontsize=11)
+
+# Set y-axis limits
+plt.ylim(bottom=0)
+
+# Add grid
+plt.grid(True, alpha=0.3, linestyle='-', linewidth=0.5, which='major')
+
+# Improve layout
+plt.tight_layout()
+plt.show()
+
-

+

@@ -6310,27 +7009,30 @@
Average Cost per Mil

Actual vs Trend Comparision

-
-
# Create the comparison DataFrame
-df_AutoCost_VariableFixed_Comparision = pd.DataFrame({
-    'Date': [2019, 2019, 2019],
-    'Actual': [
-        df_AutoCost_VariableFixed.loc[df_AutoCost_VariableFixed['Year'] == 2019, 'Variable'].iloc[0],
-        df_AutoCost_VariableFixed.loc[df_AutoCost_VariableFixed['Year'] == 2019, 'Fixed'].iloc[0],
-        df_AutoCost_VariableFixed.loc[df_AutoCost_VariableFixed['Year'] == 2019, 'Per 15k'].iloc[0]
-    ],
-    'Trend': [
-        np.poly1d(np.polyfit(pd.to_numeric(df_AutoCost_VariableFixed['Year']),
-                            pd.to_numeric(df_AutoCost_VariableFixed['Variable']), 1))(2019),
-        np.poly1d(np.polyfit(pd.to_numeric(df_AutoCost_VariableFixed['Year']),
-                            pd.to_numeric(df_AutoCost_VariableFixed['Fixed']), 1))(2019),
-        np.poly1d(np.polyfit(pd.to_numeric(df_AutoCost_VariableFixed['Year']),
-                            pd.to_numeric(df_AutoCost_VariableFixed['Per 15k']), 1))(2019)
-    ]
-}, index=['Variable', 'Fixed', 'Fixed per 15,000 Miles']).round(2)
-
-df_AutoCost_VariableFixed_Comparision
-
+
+
+Show the code +
# Create the comparison DataFrame
+df_AutoCost_VariableFixed_Comparision = pd.DataFrame({
+    'Date': [BASE_YEAR, BASE_YEAR, BASE_YEAR],
+    'Actual': [
+        df_AutoCost_VariableFixed.loc[df_AutoCost_VariableFixed['Year'] == BASE_YEAR, 'Variable'].iloc[0],
+        df_AutoCost_VariableFixed.loc[df_AutoCost_VariableFixed['Year'] == BASE_YEAR, 'Fixed'].iloc[0],
+        df_AutoCost_VariableFixed.loc[df_AutoCost_VariableFixed['Year'] == BASE_YEAR, 'Per 15k'].iloc[0]
+    ],
+    'Trend': [
+        np.poly1d(np.polyfit(pd.to_numeric(df_AutoCost_VariableFixed['Year']),
+                            pd.to_numeric(df_AutoCost_VariableFixed['Variable']), 1))(BASE_YEAR),
+        np.poly1d(np.polyfit(pd.to_numeric(df_AutoCost_VariableFixed['Year']),
+                            pd.to_numeric(df_AutoCost_VariableFixed['Fixed']), 1))(BASE_YEAR),
+        np.poly1d(np.polyfit(pd.to_numeric(df_AutoCost_VariableFixed['Year']),
+                            pd.to_numeric(df_AutoCost_VariableFixed['Per 15k']), 1))(BASE_YEAR)
+    ]
+}, index=['Variable', 'Fixed', 'Fixed per 15,000 Miles']).round(2)
+
+df_AutoCost_VariableFixed_Comparision
+
+
@@ -6346,21 +7048,21 @@

Actual vs Tr Variable -2019 -3081.00 -2990.68 +2023 +3864.00 +3405.65 Fixed -2019 -6201.00 -6498.80 +2023 +8318.00 +6929.60 Fixed per 15,000 Miles -2019 -0.41 -0.43 +2023 +0.55 +0.46 @@ -6374,35 +7076,35 @@

Actual vs Tr

Auto Cost

Create Dataframe

-
-
# Define year range
-year_range = list(range(1990, 2021)) # Last year should be one more than desired
-
-# Ensure column names are strings in both DataFrames to avoid indexing issues
-df_AverageCost.columns = df_AverageCost.columns.astype(str)
-
-# Compile data from Raw Datasets
-df_AutoCost = pd.DataFrame({
-    "Year": year_range,
-    "Gas": pd.to_numeric(
-        df_AverageCost.loc[1, str(year_range[0]):str(year_range[-1])].values,
-        errors="coerce"
-    ),
-    "Maint": pd.to_numeric(
-        df_AverageCost.loc[3, str(year_range[0]):str(year_range[-1])].values,
-        errors="coerce"
-    ),
-    "Tires": pd.to_numeric(
-        df_AverageCost.loc[4, str(year_range[0]):str(year_range[-1])].values,
-        errors="coerce"   # turns "U" into NaN
-    )
-})
-
-df_AutoCost["Maint+Tires"] = df_AutoCost["Maint"].fillna(0) + df_AutoCost["Tires"].fillna(0)
-
-# View Dataframe
-df_AutoCost
-
+
+
+Show the code +
# Define year range
+year_range = list(range(1990, BASE_YEAR+1)) # Last year should be one more than desired
+
+# Compile data from Raw Datasets
+df_AutoCost = pd.DataFrame({
+    "Year": year_range,
+    "Gas": pd.to_numeric(
+        df_AverageCost.loc[1, str(year_range[0]):str(year_range[-1])].values,
+        errors="coerce"
+    ),
+    "Maint": pd.to_numeric(
+        df_AverageCost.loc[3, str(year_range[0]):str(year_range[-1])].values,
+        errors="coerce"
+    ),
+    "Tires": pd.to_numeric(
+        df_AverageCost.loc[4, str(year_range[0]):str(year_range[-1])].values,
+        errors="coerce"   # turns "U" into NaN
+    )
+})
+
+df_AutoCost["Maint+Tires"] = df_AutoCost["Maint"].fillna(0) + df_AutoCost["Tires"].fillna(0)
+
+# View Dataframe
+df_AutoCost
+
+
@@ -6666,6 +7368,30 @@

Create Dataframe

NaN 9.12 + +31 +2021 +10.72 +9.55 +NaN +9.55 + + +32 +2022 +17.99 +9.68 +NaN +9.68 + + +33 +2023 +15.93 +9.83 +NaN +9.83 + @@ -6675,54 +7401,57 @@

Create Dataframe

Actual vs Trend Comparision

-
-
# Create the comparison DataFrame
-df_AutoCost_Comparision = pd.DataFrame({
-    'Date': [2019, 2019],
-    'Actual': [
-        df_AutoCost.loc[df_AutoCost['Year'] == 2019, 'Gas'].iloc[0],
-        df_AutoCost.loc[df_AutoCost['Year'] == 2019, 'Maint+Tires'].iloc[0]
-    ],
-    'Trend': [
-        np.poly1d(np.polyfit(pd.to_numeric(df_AutoCost['Year']),
-                            pd.to_numeric(df_AutoCost['Gas']), 1))(2019),
-        np.poly1d(np.polyfit(pd.to_numeric(df_AutoCost['Year']),
-                            pd.to_numeric(df_AutoCost['Maint+Tires']), 1))(2019)
-    ]
-}, index=['Gas', 'Maint+Tires']).round(2)
-
-df_AutoCost_Comparision
-
+
+
+Show the code +
# Create the comparison DataFrame
+df_AutoCost_Comparision = pd.DataFrame({
+    'Date': [BASE_YEAR, BASE_YEAR],
+    'Actual': [
+        df_AutoCost.loc[df_AutoCost['Year'] == BASE_YEAR, 'Gas'].iloc[0],
+        df_AutoCost.loc[df_AutoCost['Year'] == BASE_YEAR, 'Maint+Tires'].iloc[0]
+    ],
+    'Trend': [
+        np.poly1d(np.polyfit(pd.to_numeric(df_AutoCost['Year']),
+                            pd.to_numeric(df_AutoCost['Gas']), 1))(BASE_YEAR),
+        np.poly1d(np.polyfit(pd.to_numeric(df_AutoCost['Year']),
+                            pd.to_numeric(df_AutoCost['Maint+Tires']), 1))(BASE_YEAR)
+    ]
+}, index=['Gas', 'Maint+Tires']).round(2)
+
+df_AutoCost_Comparision
+
+
@@ -6763,15 +7495,15 @@

Actual vs Tr Gas -2019 -11.60 -12.31 +2023 +15.93 +13.93 Maint+Tires -2019 -8.94 -7.63 +2023 +9.83 +8.77 @@ -6785,35 +7517,38 @@

Actual vs Tr

Vehicle Miles - Trucks

Create Dataframe

-
-
# Define year range
-year_range = list(range(1990, 2020)) # Last year should be one more than desired
-
-# Ensure column names are strings in both DataFrames to avoid indexing issues
-df_FE_Heavy.columns = df_FE_Heavy.columns.astype(str)
-df_FE_Medium.columns = df_FE_Medium.columns.astype(str)
-df_4_11.columns = df_4_11.columns.astype(str)
-
-# Compile data from Raw Datasets
-df_VehicleMiles_Truck = pd.DataFrame({
-  "Year": year_range,
-  "Heavy": pd.to_numeric(
-    df_FE_Heavy.loc[3, str(year_range[0]):str(year_range[-1])].values,
-    errors="coerce"
-  ),
-  "Medium": pd.to_numeric(
-    df_FE_Medium.loc[3, str(year_range[0]):str(year_range[-1])].values,
-    errors="coerce"
-  ),
-  "Light": pd.to_numeric(
-    df_4_11.loc[10, str(year_range[0]):str(year_range[-1])].values,
-    errors="coerce"
-  )
-})
-
-# View dataframe
-df_VehicleMiles_Truck
-
+
+
+Show the code +
# Define year range
+year_range = list(range(1990, BASE_YEAR+1)) # Last year should be one more than desired
+
+# Ensure column names are strings in both DataFrames to avoid indexing issues
+df_FE_Heavy.columns = df_FE_Heavy.columns.astype(str)
+df_FE_Medium.columns = df_FE_Medium.columns.astype(str)
+df_4_11.columns = df_4_11.columns.astype(str)
+
+# Compile data from Raw Datasets
+df_VehicleMiles_Truck = pd.DataFrame({
+  "Year": year_range,
+  "Heavy": pd.to_numeric(
+    df_FE_Heavy.loc[3, str(year_range[0]):str(year_range[-1])].values,
+    errors="coerce"
+  ),
+  "Medium": pd.to_numeric(
+    df_FE_Medium.loc[3, str(year_range[0]):str(year_range[-1])].values,
+    errors="coerce"
+  ),
+  "Light": pd.to_numeric(
+    df_4_11.loc[10, str(year_range[0]):str(year_range[-1])].values,
+    errors="coerce"
+  )
+})
+
+# View dataframe
+df_VehicleMiles_Truck
+
+
@@ -6859,22 +7594,22 @@

Create Dataframe

4 1994 -69.000815 -12.971235 -11.210377 +64.782647 +12.490664 +11.075156 5 1995 -68.082519 -12.481911 -11.202821 +68.084661 +12.482321 +11.280033 6 1996 68.222714 -12.167043 +12.157766 11.322535 @@ -6922,28 +7657,28 @@

Create Dataframe

13 2003 -73.428301 +73.428148 13.293659 12.323788 14 2004 -70.819043 +70.818929 12.731804 12.459739 15 2005 -69.019949 +69.019775 12.274076 12.509663 16 2006 -65.525633 +65.525738 12.083042 12.485488 @@ -6957,7 +7692,7 @@

Create Dataframe

18 2008 -71.106154 +71.106167 15.305740 10.290338 @@ -7038,6 +7773,34 @@

Create Dataframe

12.277598 11.599293 + +30 +2020 +60.120055 +11.892139 +9.927714 + + +31 +2021 +62.169340 +12.286980 +10.573179 + + +32 +2022 +60.018216 +12.290132 +10.847376 + + +33 +2023 +58.890253 +11.592949 +11.025760 + @@ -7048,117 +7811,123 @@

Create Dataframe