From 404025ad17f5c106abca36a9127f1ec9b4f429d8 Mon Sep 17 00:00:00 2001 From: yuzhouw313 Date: Tue, 14 Nov 2023 21:14:45 +0000 Subject: [PATCH 01/11] first draft of MN abstract class, entity map not done --- notebooks/MN_EDA.ipynb | 2679 +++++++------------------------------ utils/clean.py | 14 +- utils/constants.py | 81 ++ utils/mn_state_cleaner.py | 317 +++++ 4 files changed, 884 insertions(+), 2207 deletions(-) create mode 100644 utils/mn_state_cleaner.py diff --git a/notebooks/MN_EDA.ipynb b/notebooks/MN_EDA.ipynb index 92ca2b0..2a80427 100644 --- a/notebooks/MN_EDA.ipynb +++ b/notebooks/MN_EDA.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ @@ -3011,6 +3011,25 @@ "fig.show()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Observations and Interpretations\n", + "1. Individuals, excluding lobbyists, constitute the largest share of contributions in the MN dataset.\n", + "2. The second most substantial contributor category is General Purpose Political Committee or Fund, followed by lobbyists.\n", + "3. Contributions from other donor types are notably lower throughout the years.\n", + "4. Analyzing a sample from 2018 to 2022, we observe a cyclical pattern with a major increase in contributions, followed by three years of reduced contribution totals. This cycle aligns with the four-year election cycle.\n", + "5. From 1998 to 2023, there are several years with significantly lower contribution amount: 1999, 2001, 2003, 2007, 2011." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 3.2 Compare donation by recipient types" + ] + }, { "cell_type": "code", "execution_count": null, @@ -3025,226 +3044,106 @@ "data": [ { "alignmentgroup": "True", - "hovertemplate": "Donor Type=Association not registered with the Board
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "Association not registered with the Board", + "hovertemplate": "Recipient Type=Candidate
Year=%{x}
Total Contributions=%{y}", + "legendgroup": "Candidate", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, - "name": "Association not registered with the Board", - "offsetgroup": "Association not registered with the Board", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - 2022 - ], - "xaxis": "x", - "y": [ - 1067.47 - ], - "yaxis": "y" - }, - { - "alignmentgroup": "True", - "hovertemplate": "Donor Type=Candidate committee
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "Candidate committee", - "marker": { - "color": "#00cc96", - "pattern": { - "shape": "" - } - }, - "name": "Candidate committee", - "offsetgroup": "Candidate committee", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - 2022 - ], - "xaxis": "x", - "y": [ - 641245.11 - ], - "yaxis": "y" - }, - { - "alignmentgroup": "True", - "hovertemplate": "Donor Type=Lobbyist
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "Lobbyist", - "marker": { - "color": "#ab63fa", - "pattern": { - "shape": "" - } - }, - "name": "Lobbyist", - "offsetgroup": "Lobbyist", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - 2022 - ], - "xaxis": "x", - "y": [ - 1953755.2 - ], - "yaxis": "y" - }, - { - "alignmentgroup": "True", - "hovertemplate": "Donor Type=Local candidate committee registered with Hennepin County
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "Local candidate committee registered with Hennepin County", - "marker": { - "color": "#FFA15A", - "pattern": { - "shape": "" - } - }, - "name": "Local candidate committee registered with Hennepin County", - "offsetgroup": "Local candidate committee registered with Hennepin County", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - 2022 - ], - "xaxis": "x", - "y": [ - 6750 - ], - "yaxis": "y" - }, - { - "alignmentgroup": "True", - "hovertemplate": "Donor Type=Non-lobbyist individual
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "Non-lobbyist individual", - "marker": { - "color": "#19d3f3", - "pattern": { - "shape": "" - } - }, - "name": "Non-lobbyist individual", - "offsetgroup": "Non-lobbyist individual", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - 2022 - ], - "xaxis": "x", - "y": [ - 46536784.82 - ], - "yaxis": "y" - }, - { - "alignmentgroup": "True", - "hovertemplate": "Donor Type=Other
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "Other", - "marker": { - "color": "#FF6692", - "pattern": { - "shape": "" - } - }, - "name": "Other", - "offsetgroup": "Other", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - 2022 - ], - "xaxis": "x", - "y": [ - 239708.38 - ], - "yaxis": "y" - }, - { - "alignmentgroup": "True", - "hovertemplate": "Donor Type=Political committee or fund
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "Political committee or fund", - "marker": { - "color": "#B6E880", - "pattern": { - "shape": "" - } - }, - "name": "Political committee or fund", - "offsetgroup": "Political committee or fund", + "name": "Candidate", + "offsetgroup": "Candidate", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ - 2022 + 2018, + 2019, + 2020, + 2021, + 2022, + 2023 ], "xaxis": "x", "y": [ - 6411623.78 + 45075149.29, + 23545018.91, + 31859975.5, + 24773070.92, + 54222877.08, + 40405 ], "yaxis": "y" }, { "alignmentgroup": "True", - "hovertemplate": "Donor Type=Political party unit
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "Political party unit", + "hovertemplate": "Recipient Type=PCF
Year=%{x}
Total Contributions=%{y}", + "legendgroup": "PCF", "marker": { - "color": "#FF97FF", + "color": "#EF553B", "pattern": { "shape": "" } }, - "name": "Political party unit", - "offsetgroup": "Political party unit", + "name": "PCF", + "offsetgroup": "PCF", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ - 2022 + 2018, + 2019, + 2020, + 2021, + 2022, + 2023 ], "xaxis": "x", "y": [ - 1624652.29 + 1656145.98, + 1459419.13, + 1701776.18, + 1508361.7, + 2292700.66, + 218273.57 ], "yaxis": "y" }, { "alignmentgroup": "True", - "hovertemplate": "Donor Type=Self
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "Self", + "hovertemplate": "Recipient Type=PTU
Year=%{x}
Total Contributions=%{y}", + "legendgroup": "PTU", "marker": { - "color": "#FECB52", + "color": "#00cc96", "pattern": { "shape": "" } }, - "name": "Self", - "offsetgroup": "Self", + "name": "PTU", + "offsetgroup": "PTU", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ - 2022 + 2018, + 2019, + 2020, + 2021, + 2022, + 2023 ], "xaxis": "x", "y": [ - 268027.56 + 1050553.6, + 760467.56, + 1052667.39, + 617345.59, + 1176668.38, + 6283.35 ], "yaxis": "y" } @@ -3253,7 +3152,7 @@ "barmode": "relative", "legend": { "title": { - "text": "Donor Type" + "text": "Recipient Type" }, "tracegroupgap": 0 }, @@ -4074,7 +3973,7 @@ } }, "title": { - "text": "Donations by Donor Type in 2022" + "text": "Donations by Recipient Type from 2018 to 2023" }, "xaxis": { "anchor": "y", @@ -4099,2030 +3998,9 @@ } }, "text/html": [ - "
" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "filtered_df2 = contribution_df[contribution_df['Year'] == 2022]\n", - "grouped3 = filtered_df2.groupby(['Year', 'DonorType'])['TotalAmount'].sum().reset_index()\n", - "\n", - "grouped3['FullDonorType'] = grouped3['DonorType'].map(donor_type_mapping)\n", - "\n", - "fig = px.bar(\n", - " grouped3,\n", - " x='Year',\n", - " y='TotalAmount',\n", - " color='FullDonorType',\n", - " title='Donations by Donor Type in 2022',\n", - " labels={\"DonationYear\": \"Year\", \"TotalAmount\": \"Total Contributions\", \"FullDonorType\": \"Donor Type\"},\n", - " category_orders={\"FullDonorType\": sorted(donor_type_mapping.values())}\n", - ")\n", - "\n", - "fig.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Observations and Interpretations\n", - "1. Individuals, excluding lobbyists, constitute the largest share of contributions in the MN dataset.\n", - "2. The second most substantial contributor category is General Purpose Political Committee or Fund, followed by lobbyists.\n", - "3. Contributions from other donor types are notably lower throughout the years.\n", - "4. Analyzing a sample from 2018 to 2022, we observe a cyclical pattern with a major increase in contributions, followed by three years of reduced contribution totals. This cycle aligns with the four-year election cycle.\n", - "5. From 1998 to 2023, there are several years with significantly lower contribution amount: 1999, 2001, 2003, 2007, 2011." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 3.2 Compare donation by recipient types" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.plotly.v1+json": { - "config": { - "plotlyServerURL": "https://plot.ly" - }, - "data": [ - { - "alignmentgroup": "True", - "hovertemplate": "Recipient Type=Candidate
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "Candidate", - "marker": { - "color": "#636efa", - "pattern": { - "shape": "" - } - }, - "name": "Candidate", - "offsetgroup": "Candidate", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - 2018, - 2019, - 2020, - 2021, - 2022, - 2023 - ], - "xaxis": "x", - "y": [ - 45075149.29, - 23545018.91, - 31859975.5, - 24773070.92, - 54222877.08, - 40405 - ], - "yaxis": "y" - }, - { - "alignmentgroup": "True", - "hovertemplate": "Recipient Type=PCF
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "PCF", - "marker": { - "color": "#EF553B", - "pattern": { - "shape": "" - } - }, - "name": "PCF", - "offsetgroup": "PCF", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - 2018, - 2019, - 2020, - 2021, - 2022, - 2023 - ], - "xaxis": "x", - "y": [ - 1656145.98, - 1459419.13, - 1701776.18, - 1508361.7, - 2292700.66, - 218273.57 - ], - "yaxis": "y" - }, - { - "alignmentgroup": "True", - "hovertemplate": "Recipient Type=PTU
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "PTU", - "marker": { - "color": "#00cc96", - "pattern": { - "shape": "" - } - }, - "name": "PTU", - "offsetgroup": "PTU", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - 2018, - 2019, - 2020, - 2021, - 2022, - 2023 - ], - "xaxis": "x", - "y": [ - 1050553.6, - 760467.56, - 1052667.39, - 617345.59, - 1176668.38, - 6283.35 - ], - "yaxis": "y" - } - ], - "layout": { - "barmode": "relative", - "legend": { - "title": { - "text": "Recipient Type" - }, - "tracegroupgap": 0 - }, - "template": { - "data": { - "bar": [ - { - "error_x": { - "color": "#2a3f5f" - }, - "error_y": { - "color": "#2a3f5f" - }, - "marker": { - "line": { - "color": "#E5ECF6", - "width": 0.5 - }, - "pattern": { - "fillmode": "overlay", - "size": 10, - "solidity": 0.2 - } - }, - "type": "bar" - } - ], - "barpolar": [ - { - "marker": { - "line": { - "color": "#E5ECF6", - "width": 0.5 - }, - "pattern": { - "fillmode": "overlay", - "size": 10, - "solidity": 0.2 - } - }, - "type": "barpolar" - } - ], - "carpet": [ - { - "aaxis": { - "endlinecolor": "#2a3f5f", - "gridcolor": "white", - "linecolor": "white", - "minorgridcolor": "white", - "startlinecolor": "#2a3f5f" - }, - "baxis": { - "endlinecolor": "#2a3f5f", - "gridcolor": "white", - "linecolor": "white", - "minorgridcolor": "white", - "startlinecolor": "#2a3f5f" - }, - "type": "carpet" - } - ], - "choropleth": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "type": "choropleth" - } - ], - "contour": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "colorscale": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ], - "type": "contour" - } - ], - "contourcarpet": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "type": "contourcarpet" - } - ], - "heatmap": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "colorscale": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ], - "type": "heatmap" - } - ], - "heatmapgl": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "colorscale": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ], - "type": "heatmapgl" - } - ], - "histogram": [ - { - "marker": { - "pattern": { - "fillmode": "overlay", - "size": 10, - "solidity": 0.2 - } - }, - "type": "histogram" - } - ], - "histogram2d": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "colorscale": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ], - "type": "histogram2d" - } - ], - "histogram2dcontour": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "colorscale": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ], - "type": "histogram2dcontour" - } - ], - "mesh3d": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "type": "mesh3d" - } - ], - "parcoords": [ - { - "line": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "parcoords" - } - ], - "pie": [ - { - "automargin": true, - "type": "pie" - } - ], - "scatter": [ - { - "fillpattern": { - "fillmode": "overlay", - "size": 10, - "solidity": 0.2 - }, - "type": "scatter" - } - ], - "scatter3d": [ - { - "line": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scatter3d" - } - ], - "scattercarpet": [ - { - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scattercarpet" - } - ], - "scattergeo": [ - { - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scattergeo" - } - ], - "scattergl": [ - { - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scattergl" - } - ], - "scattermapbox": [ - { - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scattermapbox" - } - ], - "scatterpolar": [ - { - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scatterpolar" - } - ], - "scatterpolargl": [ - { - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scatterpolargl" - } - ], - "scatterternary": [ - { - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scatterternary" - } - ], - "surface": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "colorscale": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ], - "type": "surface" - } - ], - "table": [ - { - "cells": { - "fill": { - "color": "#EBF0F8" - }, - "line": { - "color": "white" - } - }, - "header": { - "fill": { - "color": "#C8D4E3" - }, - "line": { - "color": "white" - } - }, - "type": "table" - } - ] - }, - "layout": { - "annotationdefaults": { - "arrowcolor": "#2a3f5f", - "arrowhead": 0, - "arrowwidth": 1 - }, - "autotypenumbers": "strict", - "coloraxis": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "colorscale": { - "diverging": [ - [ - 0, - "#8e0152" - ], - [ - 0.1, - "#c51b7d" - ], - [ - 0.2, - "#de77ae" - ], - [ - 0.3, - "#f1b6da" - ], - [ - 0.4, - "#fde0ef" - ], - [ - 0.5, - "#f7f7f7" - ], - [ - 0.6, - "#e6f5d0" - ], - [ - 0.7, - "#b8e186" - ], - [ - 0.8, - "#7fbc41" - ], - [ - 0.9, - "#4d9221" - ], - [ - 1, - "#276419" - ] - ], - "sequential": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ], - "sequentialminus": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ] - }, - "colorway": [ - "#636efa", - "#EF553B", - "#00cc96", - "#ab63fa", - "#FFA15A", - "#19d3f3", - "#FF6692", - "#B6E880", - "#FF97FF", - "#FECB52" - ], - "font": { - "color": "#2a3f5f" - }, - "geo": { - "bgcolor": "white", - "lakecolor": "white", - "landcolor": "#E5ECF6", - "showlakes": true, - "showland": true, - "subunitcolor": "white" - }, - "hoverlabel": { - "align": "left" - }, - "hovermode": "closest", - "mapbox": { - "style": "light" - }, - "paper_bgcolor": "white", - "plot_bgcolor": "#E5ECF6", - "polar": { - "angularaxis": { - "gridcolor": "white", - "linecolor": "white", - "ticks": "" - }, - "bgcolor": "#E5ECF6", - "radialaxis": { - "gridcolor": "white", - "linecolor": "white", - "ticks": "" - } - }, - "scene": { - "xaxis": { - "backgroundcolor": "#E5ECF6", - "gridcolor": "white", - "gridwidth": 2, - "linecolor": "white", - "showbackground": true, - "ticks": "", - "zerolinecolor": "white" - }, - "yaxis": { - "backgroundcolor": "#E5ECF6", - "gridcolor": "white", - "gridwidth": 2, - "linecolor": "white", - "showbackground": true, - "ticks": "", - "zerolinecolor": "white" - }, - "zaxis": { - "backgroundcolor": "#E5ECF6", - "gridcolor": "white", - "gridwidth": 2, - "linecolor": "white", - "showbackground": true, - "ticks": "", - "zerolinecolor": "white" - } - }, - "shapedefaults": { - "line": { - "color": "#2a3f5f" - } - }, - "ternary": { - "aaxis": { - "gridcolor": "white", - "linecolor": "white", - "ticks": "" - }, - "baxis": { - "gridcolor": "white", - "linecolor": "white", - "ticks": "" - }, - "bgcolor": "#E5ECF6", - "caxis": { - "gridcolor": "white", - "linecolor": "white", - "ticks": "" - } - }, - "title": { - "x": 0.05 - }, - "xaxis": { - "automargin": true, - "gridcolor": "white", - "linecolor": "white", - "ticks": "", - "title": { - "standoff": 15 - }, - "zerolinecolor": "white", - "zerolinewidth": 2 - }, - "yaxis": { - "automargin": true, - "gridcolor": "white", - "linecolor": "white", - "ticks": "", - "title": { - "standoff": 15 - }, - "zerolinecolor": "white", - "zerolinewidth": 2 - } - } - }, - "title": { - "text": "Donations by Recipient Type from 2018 to 2023" - }, - "xaxis": { - "anchor": "y", - "domain": [ - 0, - 1 - ], - "title": { - "text": "Year" - } - }, - "yaxis": { - "anchor": "x", - "domain": [ - 0, - 1 - ], - "title": { - "text": "Total Contributions" - } - } - } - }, - "text/html": [ - "
" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "grouped4 = filtered_df.groupby(['Year', 'RecipientType'])['TotalAmount'].sum().reset_index()\n", - "\n", - "fig = px.bar(\n", - " grouped4,\n", - " x='Year',\n", - " y='TotalAmount',\n", - " color='RecipientType',\n", - " title='Donations by Recipient Type from 2018 to 2023',\n", - " labels={\"Year\": \"Year\", \"TotalAmount\": \"Total Contributions\", 'RecipientType': 'Recipient Type'},\n", - ")\n", - "\n", - "fig.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.plotly.v1+json": { - "config": { - "plotlyServerURL": "https://plot.ly" - }, - "data": [ - { - "alignmentgroup": "True", - "hovertemplate": "Recipient Type=Candidate
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "Candidate", - "marker": { - "color": "#636efa", - "pattern": { - "shape": "" - } - }, - "name": "Candidate", - "offsetgroup": "Candidate", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - 2022 - ], - "xaxis": "x", - "y": [ - 54222877.08 - ], - "yaxis": "y" - }, - { - "alignmentgroup": "True", - "hovertemplate": "Recipient Type=PCF
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "PCF", - "marker": { - "color": "#EF553B", - "pattern": { - "shape": "" - } - }, - "name": "PCF", - "offsetgroup": "PCF", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - 2022 - ], - "xaxis": "x", - "y": [ - 2292700.66 - ], - "yaxis": "y" - }, - { - "alignmentgroup": "True", - "hovertemplate": "Recipient Type=PTU
Year=%{x}
Total Contributions=%{y}", - "legendgroup": "PTU", - "marker": { - "color": "#00cc96", - "pattern": { - "shape": "" - } - }, - "name": "PTU", - "offsetgroup": "PTU", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - 2022 - ], - "xaxis": "x", - "y": [ - 1176668.38 - ], - "yaxis": "y" - } - ], - "layout": { - "barmode": "relative", - "legend": { - "title": { - "text": "Recipient Type" - }, - "tracegroupgap": 0 - }, - "template": { - "data": { - "bar": [ - { - "error_x": { - "color": "#2a3f5f" - }, - "error_y": { - "color": "#2a3f5f" - }, - "marker": { - "line": { - "color": "#E5ECF6", - "width": 0.5 - }, - "pattern": { - "fillmode": "overlay", - "size": 10, - "solidity": 0.2 - } - }, - "type": "bar" - } - ], - "barpolar": [ - { - "marker": { - "line": { - "color": "#E5ECF6", - "width": 0.5 - }, - "pattern": { - "fillmode": "overlay", - "size": 10, - "solidity": 0.2 - } - }, - "type": "barpolar" - } - ], - "carpet": [ - { - "aaxis": { - "endlinecolor": "#2a3f5f", - "gridcolor": "white", - "linecolor": "white", - "minorgridcolor": "white", - "startlinecolor": "#2a3f5f" - }, - "baxis": { - "endlinecolor": "#2a3f5f", - "gridcolor": "white", - "linecolor": "white", - "minorgridcolor": "white", - "startlinecolor": "#2a3f5f" - }, - "type": "carpet" - } - ], - "choropleth": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "type": "choropleth" - } - ], - "contour": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "colorscale": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ], - "type": "contour" - } - ], - "contourcarpet": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "type": "contourcarpet" - } - ], - "heatmap": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "colorscale": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ], - "type": "heatmap" - } - ], - "heatmapgl": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "colorscale": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ], - "type": "heatmapgl" - } - ], - "histogram": [ - { - "marker": { - "pattern": { - "fillmode": "overlay", - "size": 10, - "solidity": 0.2 - } - }, - "type": "histogram" - } - ], - "histogram2d": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "colorscale": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ], - "type": "histogram2d" - } - ], - "histogram2dcontour": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "colorscale": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ], - "type": "histogram2dcontour" - } - ], - "mesh3d": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "type": "mesh3d" - } - ], - "parcoords": [ - { - "line": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "parcoords" - } - ], - "pie": [ - { - "automargin": true, - "type": "pie" - } - ], - "scatter": [ - { - "fillpattern": { - "fillmode": "overlay", - "size": 10, - "solidity": 0.2 - }, - "type": "scatter" - } - ], - "scatter3d": [ - { - "line": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scatter3d" - } - ], - "scattercarpet": [ - { - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scattercarpet" - } - ], - "scattergeo": [ - { - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scattergeo" - } - ], - "scattergl": [ - { - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scattergl" - } - ], - "scattermapbox": [ - { - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scattermapbox" - } - ], - "scatterpolar": [ - { - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scatterpolar" - } - ], - "scatterpolargl": [ - { - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scatterpolargl" - } - ], - "scatterternary": [ - { - "marker": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "type": "scatterternary" - } - ], - "surface": [ - { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - }, - "colorscale": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ], - "type": "surface" - } - ], - "table": [ - { - "cells": { - "fill": { - "color": "#EBF0F8" - }, - "line": { - "color": "white" - } - }, - "header": { - "fill": { - "color": "#C8D4E3" - }, - "line": { - "color": "white" - } - }, - "type": "table" - } - ] - }, - "layout": { - "annotationdefaults": { - "arrowcolor": "#2a3f5f", - "arrowhead": 0, - "arrowwidth": 1 - }, - "autotypenumbers": "strict", - "coloraxis": { - "colorbar": { - "outlinewidth": 0, - "ticks": "" - } - }, - "colorscale": { - "diverging": [ - [ - 0, - "#8e0152" - ], - [ - 0.1, - "#c51b7d" - ], - [ - 0.2, - "#de77ae" - ], - [ - 0.3, - "#f1b6da" - ], - [ - 0.4, - "#fde0ef" - ], - [ - 0.5, - "#f7f7f7" - ], - [ - 0.6, - "#e6f5d0" - ], - [ - 0.7, - "#b8e186" - ], - [ - 0.8, - "#7fbc41" - ], - [ - 0.9, - "#4d9221" - ], - [ - 1, - "#276419" - ] - ], - "sequential": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ], - "sequentialminus": [ - [ - 0, - "#0d0887" - ], - [ - 0.1111111111111111, - "#46039f" - ], - [ - 0.2222222222222222, - "#7201a8" - ], - [ - 0.3333333333333333, - "#9c179e" - ], - [ - 0.4444444444444444, - "#bd3786" - ], - [ - 0.5555555555555556, - "#d8576b" - ], - [ - 0.6666666666666666, - "#ed7953" - ], - [ - 0.7777777777777778, - "#fb9f3a" - ], - [ - 0.8888888888888888, - "#fdca26" - ], - [ - 1, - "#f0f921" - ] - ] - }, - "colorway": [ - "#636efa", - "#EF553B", - "#00cc96", - "#ab63fa", - "#FFA15A", - "#19d3f3", - "#FF6692", - "#B6E880", - "#FF97FF", - "#FECB52" - ], - "font": { - "color": "#2a3f5f" - }, - "geo": { - "bgcolor": "white", - "lakecolor": "white", - "landcolor": "#E5ECF6", - "showlakes": true, - "showland": true, - "subunitcolor": "white" - }, - "hoverlabel": { - "align": "left" - }, - "hovermode": "closest", - "mapbox": { - "style": "light" - }, - "paper_bgcolor": "white", - "plot_bgcolor": "#E5ECF6", - "polar": { - "angularaxis": { - "gridcolor": "white", - "linecolor": "white", - "ticks": "" - }, - "bgcolor": "#E5ECF6", - "radialaxis": { - "gridcolor": "white", - "linecolor": "white", - "ticks": "" - } - }, - "scene": { - "xaxis": { - "backgroundcolor": "#E5ECF6", - "gridcolor": "white", - "gridwidth": 2, - "linecolor": "white", - "showbackground": true, - "ticks": "", - "zerolinecolor": "white" - }, - "yaxis": { - "backgroundcolor": "#E5ECF6", - "gridcolor": "white", - "gridwidth": 2, - "linecolor": "white", - "showbackground": true, - "ticks": "", - "zerolinecolor": "white" - }, - "zaxis": { - "backgroundcolor": "#E5ECF6", - "gridcolor": "white", - "gridwidth": 2, - "linecolor": "white", - "showbackground": true, - "ticks": "", - "zerolinecolor": "white" - } - }, - "shapedefaults": { - "line": { - "color": "#2a3f5f" - } - }, - "ternary": { - "aaxis": { - "gridcolor": "white", - "linecolor": "white", - "ticks": "" - }, - "baxis": { - "gridcolor": "white", - "linecolor": "white", - "ticks": "" - }, - "bgcolor": "#E5ECF6", - "caxis": { - "gridcolor": "white", - "linecolor": "white", - "ticks": "" - } - }, - "title": { - "x": 0.05 - }, - "xaxis": { - "automargin": true, - "gridcolor": "white", - "linecolor": "white", - "ticks": "", - "title": { - "standoff": 15 - }, - "zerolinecolor": "white", - "zerolinewidth": 2 - }, - "yaxis": { - "automargin": true, - "gridcolor": "white", - "linecolor": "white", - "ticks": "", - "title": { - "standoff": 15 - }, - "zerolinecolor": "white", - "zerolinewidth": 2 - } - } - }, - "title": { - "text": "Donations by Recipient Type in 2022" - }, - "xaxis": { - "anchor": "y", - "domain": [ - 0, - 1 - ], - "title": { - "text": "Year" - } - }, - "yaxis": { - "anchor": "x", - "domain": [ - 0, - 1 - ], - "title": { - "text": "Total Contributions" - } - } - } - }, - "text/html": [ - "
\n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + }, { "data": { "application/vnd.plotly.v1+json": { @@ -2962,9 +2996,9 @@ } }, "text/html": [ - "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "grouped4 = filtered_df2.groupby(['Year', 'RecipientType'])['TotalAmount'].sum().reset_index()\n", + "\n", + "fig = px.bar(\n", + " grouped4,\n", + " x='RecipientType', # Use 'RecipientType' as the x-axis\n", + " y='TotalAmount',\n", + " color='RecipientType',\n", + " title='Donations by Recipient Type in 2022',\n", + " labels={\"TotalAmount\": \"Total Contributions\", 'RecipientType': 'Recipient Type'},\n", + " facet_col='Year', # Use facet_col to create separate bars for each year (optional)\n", + ")\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Observations and Interpretations\n", + "1. Candidates, as the recipients, make up the overwhelming majority of contributions.\n", + "2. Examining the period from 1998 to 2023, a distinct cyclical pattern emerges, characterized by alternating years of increased and decreased contributions, which may correspond to congressional elections or MN state house representatives elections which take place every two years.\n", + "3. Starting in 2012, recipient types \"Political Committee or Fund\" and \"Political Party Unit\" began receiving a larger share of contributions compared to prior years." + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [], + "source": [ + "race_type_mapping = {\n", + " 'AG': 'Attorney General',\n", + " 'AP': 'State Appeals Court Judge',\n", + " 'DC': 'State District Court Judge',\n", + " 'GC': 'Governor',\n", + " 'House': 'State Representative',\n", + " 'SA': 'State Auditor',\n", + " 'SC': 'State Supreme Court Justice',\n", + " 'SS': 'Secretary of State',\n", + " 'ST': 'State Treasurer',\n", + " 'Senate': 'Senate'\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 33, "metadata": {}, "outputs": [ { "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
OfficeSoughtRegNumbCandFirstNameCandLastNameCommitteeDateDonorTypeDonorNameAmountInKindAmountInKindDescriptionRecipientTypeYearTotalAmount
22NaN30119NaNNaNIBEW Local 292 Political Education Fund2023-03-05OIBEW Local 29255.760.0NaNPCF202355.76
58NaN30119NaNNaNIBEW Local 292 Political Education Fund2023-03-09OIBEW Local 292262.220.0NaNPCF2023262.22
95NaN30119NaNNaNIBEW Local 292 Political Education Fund2023-02-17OIBEW Local 292550.420.0NaNPCF2023550.42
103NaN30119NaNNaNIBEW Local 292 Political Education Fund2023-02-23OIBEW Local 292133.660.0NaNPCF2023133.66
108NaN30119NaNNaNIBEW Local 292 Political Education Fund2023-02-28OIBEW Local 29275.100.0NaNPCF202375.10
.............................................
1621101NaN30119NaNNaNIBEW Local 292 Political Education Fund2012-10-18OIBEW Local 29262.300.0NaNPCF201262.30
1624800NaN30119NaNNaNIBEW Local 292 Political Education Fund2012-10-11OIBEW Local 292196.120.0NaNPCF2012196.12
2297031NaN30119NaNNaNIBEW Local 292 Political Education Fund2008-12-30OIBEW Local 29259.310.0NaNPCF200859.31
2298939NaN30119NaNNaNIBEW Local 292 Political Education Fund2008-10-14OIBEW Local 292351.600.0NaNPCF2008351.60
2300737NaN30119NaNNaNIBEW Local 292 Political Education Fund2008-10-22OIBEW Local 292112.140.0NaNPCF2008112.14
\n", - "

1010 rows × 14 columns

\n", - "
" - ], "text/plain": [ - " OfficeSought RegNumb CandFirstName CandLastName \\\n", - "22 NaN 30119 NaN NaN \n", - "58 NaN 30119 NaN NaN \n", - "95 NaN 30119 NaN NaN \n", - "103 NaN 30119 NaN NaN \n", - "108 NaN 30119 NaN NaN \n", - "... ... ... ... ... \n", - "1621101 NaN 30119 NaN NaN \n", - "1624800 NaN 30119 NaN NaN \n", - "2297031 NaN 30119 NaN NaN \n", - "2298939 NaN 30119 NaN NaN \n", - "2300737 NaN 30119 NaN NaN \n", - "\n", - " Committee Date DonorType \\\n", - "22 IBEW Local 292 Political Education Fund 2023-03-05 O \n", - "58 IBEW Local 292 Political Education Fund 2023-03-09 O \n", - "95 IBEW Local 292 Political Education Fund 2023-02-17 O \n", - "103 IBEW Local 292 Political Education Fund 2023-02-23 O \n", - "108 IBEW Local 292 Political Education Fund 2023-02-28 O \n", - "... ... ... ... \n", - "1621101 IBEW Local 292 Political Education Fund 2012-10-18 O \n", - "1624800 IBEW Local 292 Political Education Fund 2012-10-11 O \n", - "2297031 IBEW Local 292 Political Education Fund 2008-12-30 O \n", - "2298939 IBEW Local 292 Political Education Fund 2008-10-14 O \n", - "2300737 IBEW Local 292 Political Education Fund 2008-10-22 O \n", + "array(['AG', nan, 'GC', 'House', 'Senate', 'SA', 'SS', 'SC', 'DC', 'AP',\n", + " 'ST'], dtype=object)" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "contribution_df['OfficeSought'].unique()" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "plotlyServerURL": "https://plot.ly" + }, + "data": [ + { + "alignmentgroup": "True", + "hovertemplate": "Full Race Type=Attorney General
Year=%{x}
Total Contributions=%{y}", + "legendgroup": "Attorney General", + "marker": { + "color": "#636efa", + "pattern": { + "shape": "" + } + }, + "name": "Attorney General", + "offsetgroup": "Attorney General", + "orientation": "v", + "showlegend": true, + "textposition": "auto", + "type": "bar", + "x": [ + 2018, + 2019, + 2020, + 2021, + 2022, + 2023 + ], + "xaxis": "x", + "y": [ + 4003902.58, + 392454.04, + 293103, + 895901.69, + 4278017.76, + 1500 + ], + "yaxis": "y" + }, + { + "alignmentgroup": "True", + "hovertemplate": "Full Race Type=Governor
Year=%{x}
Total Contributions=%{y}", + "legendgroup": "Governor", + "marker": { + "color": "#EF553B", + "pattern": { + "shape": "" + } + }, + "name": "Governor", + "offsetgroup": "Governor", + "orientation": "v", + "showlegend": true, + "textposition": "auto", + "type": "bar", + "x": [ + 2018, + 2019, + 2020, + 2021, + 2022, + 2023 + ], + "xaxis": "x", + "y": [ + 14891205.43, + 1993660.43, + 1426981.5, + 7058411.1, + 19091855.92, + 32505 + ], + "yaxis": "y" + }, + { + "alignmentgroup": "True", + "hovertemplate": "Full Race Type=Secretary of State
Year=%{x}
Total Contributions=%{y}", + "legendgroup": "Secretary of State", + "marker": { + "color": "#00cc96", + "pattern": { + "shape": "" + } + }, + "name": "Secretary of State", + "offsetgroup": "Secretary of State", + "orientation": "v", + "showlegend": true, + "textposition": "auto", + "type": "bar", + "x": [ + 2018, + 2019, + 2020, + 2021, + 2022 + ], + "xaxis": "x", + "y": [ + 1137408.7, + 372350, + 362450, + 1167468.76, + 4795282.29 + ], + "yaxis": "y" + }, + { + "alignmentgroup": "True", + "hovertemplate": "Full Race Type=Senate
Year=%{x}
Total Contributions=%{y}", + "legendgroup": "Senate", + "marker": { + "color": "#ab63fa", + "pattern": { + "shape": "" + } + }, + "name": "Senate", + "offsetgroup": "Senate", + "orientation": "v", + "showlegend": true, + "textposition": "auto", + "type": "bar", + "x": [ + 2018, + 2019, + 2020, + 2021, + 2022, + 2023 + ], + "xaxis": "x", + "y": [ + 3036186.27, + 11018745.95, + 14723556.76, + 7701612.07, + 11084849.84, + 5400 + ], + "yaxis": "y" + }, + { + "alignmentgroup": "True", + "hovertemplate": "Full Race Type=State Appeals Court Judge
Year=%{x}
Total Contributions=%{y}", + "legendgroup": "State Appeals Court Judge", + "marker": { + "color": "#FFA15A", + "pattern": { + "shape": "" + } + }, + "name": "State Appeals Court Judge", + "offsetgroup": "State Appeals Court Judge", + "orientation": "v", + "showlegend": true, + "textposition": "auto", + "type": "bar", + "x": [ + 2018 + ], + "xaxis": "x", + "y": [ + 139482.88 + ], + "yaxis": "y" + }, + { + "alignmentgroup": "True", + "hovertemplate": "Full Race Type=State Auditor
Year=%{x}
Total Contributions=%{y}", + "legendgroup": "State Auditor", + "marker": { + "color": "#19d3f3", + "pattern": { + "shape": "" + } + }, + "name": "State Auditor", + "offsetgroup": "State Auditor", + "orientation": "v", + "showlegend": true, + "textposition": "auto", + "type": "bar", + "x": [ + 2018, + 2019, + 2020, + 2021, + 2022 + ], + "xaxis": "x", + "y": [ + 409451.94, + 50750, + 20335.42, + 85461.67, + 567693.37 + ], + "yaxis": "y" + }, + { + "alignmentgroup": "True", + "hovertemplate": "Full Race Type=State District Court Judge
Year=%{x}
Total Contributions=%{y}", + "legendgroup": "State District Court Judge", + "marker": { + "color": "#FF6692", + "pattern": { + "shape": "" + } + }, + "name": "State District Court Judge", + "offsetgroup": "State District Court Judge", + "orientation": "v", + "showlegend": true, + "textposition": "auto", + "type": "bar", + "x": [ + 2018, + 2019, + 2020, + 2022 + ], + "xaxis": "x", + "y": [ + 611312.41, + 2750, + 98175.46, + 32351.04 + ], + "yaxis": "y" + }, + { + "alignmentgroup": "True", + "hovertemplate": "Full Race Type=State Representative
Year=%{x}
Total Contributions=%{y}", + "legendgroup": "State Representative", + "marker": { + "color": "#B6E880", + "pattern": { + "shape": "" + } + }, + "name": "State Representative", + "offsetgroup": "State Representative", + "orientation": "v", + "showlegend": true, + "textposition": "auto", + "type": "bar", + "x": [ + 2018, + 2019, + 2020, + 2021, + 2022, + 2023 + ], + "xaxis": "x", + "y": [ + 20544735.5, + 9615308.49, + 14631841.16, + 7864215.63, + 14370826.86, + 1000 + ], + "yaxis": "y" + }, + { + "alignmentgroup": "True", + "hovertemplate": "Full Race Type=State Supreme Court Justice
Year=%{x}
Total Contributions=%{y}", + "legendgroup": "State Supreme Court Justice", + "marker": { + "color": "#FF97FF", + "pattern": { + "shape": "" + } + }, + "name": "State Supreme Court Justice", + "offsetgroup": "State Supreme Court Justice", + "orientation": "v", + "showlegend": true, + "textposition": "auto", + "type": "bar", + "x": [ + 2018, + 2019, + 2020, + 2022 + ], + "xaxis": "x", + "y": [ + 301463.58, + 99000, + 303532.2, + 2000 + ], + "yaxis": "y" + } + ], + "layout": { + "barmode": "relative", + "legend": { + "title": { + "text": "Full Race Type" + }, + "tracegroupgap": 0 + }, + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "#2a3f5f" + }, + "error_y": { + "color": "#2a3f5f" + }, + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "baxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "fillpattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#EBF0F8" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "#C8D4E3" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowcolor": "#2a3f5f", + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ], + "sequential": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ] + }, + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#2a3f5f" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "#E5ECF6", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "#E5ECF6", + "polar": { + "angularaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "radialaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "yaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "zaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + } + }, + "shapedefaults": { + "line": { + "color": "#2a3f5f" + } + }, + "ternary": { + "aaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "baxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "caxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + }, + "yaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + } + } + }, + "title": { + "text": "Donations by Candidate Recipient Race From 2018 To 2023" + }, + "xaxis": { + "anchor": "y", + "domain": [ + 0, + 1 + ], + "title": { + "text": "Year" + } + }, + "yaxis": { + "anchor": "x", + "domain": [ + 0, + 1 + ], + "title": { + "text": "Total Contributions" + } + } + } + }, + "text/html": [ + "
" ] }, - "execution_count": 29, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" } ], "source": [ - "contribution_df[contribution_df['RegNumb']==30119]" + "grouped5 = filtered_df.groupby(['Year', 'OfficeSought'])['TotalAmount'].sum().reset_index()\n", + "grouped5['FullRaceType'] = grouped5['OfficeSought'].map(race_type_mapping)\n", + "\n", + "fig = px.bar(\n", + " grouped5,\n", + " x='Year',\n", + " y='TotalAmount',\n", + " color='FullRaceType',\n", + " title='Donations by Candidate Recipient Race From 2018 To 2023',\n", + " labels={\"Year\": \"Year\", \"TotalAmount\": \"Total Contributions\", 'FullRaceType': 'Full Race Type'},\n", + " category_orders={\"FullRaceType\": sorted(race_type_mapping.values())}\n", + ")\n", + "\n", + "fig.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "# MN Expenditure EDA" + "Clearly, state senators and house representatives recieve the most contributions" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### 1. Read in and Preprocess Datasets" + "# MN Expenditure EDA" ] }, { - "cell_type": "code", - "execution_count": 13, + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "df_general = pd.read_csv('/project/data/general_exp_con.csv')\n", - "df_independent = pd.read_csv('/project/data/independent_exp.csv')" + "### 1. Read in and Preprocess Datasets" ] }, { @@ -5614,44 +7529,31 @@ "metadata": {}, "outputs": [], "source": [ - "from utils.MN_util import preprocess_general_exp_df\n", - "df_general = preprocess_general_exp_df(df_general)" + "df_independent = pd.read_csv('/project/data/independent_exp.csv')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, - "outputs": [], - "source": [ - "from utils.MN_util import preprocess_independent_exp_df\n", - "df_independent = preprocess_independent_exp_df(df_independent)" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "array([ True, True, True, True, True, True, True, True, True,\n", - " True, True, True, True, True])" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_56567/3801224637.py:2: DeprecationWarning: Call to deprecated function preprocess_expenditure.\n", + " df_expenditure = preprocess_expenditure(df_independent)\n" + ] } ], "source": [ - "df_independent.columns==df_general.columns" + "from utils.MN_util import preprocess_expenditure\n", + "df_expenditure = preprocess_expenditure(df_independent)" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -5674,29 +7576,18 @@ "dtype: object" ] }, - "execution_count": 6, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "df_independent.dtypes" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [], - "source": [ - "from utils.MN_util import preprocess_expenditure_df\n", - "\n", - "df_expenditure = preprocess_expenditure_df([df_general, df_independent])" + "df_expenditure.dtypes" ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -5739,88 +7630,88 @@ " \n", " \n", " 0\n", - " 15863\n", - " Hooten, Carol Dist Court Committee\n", - " PCC\n", - " NaN\n", - " 102.84\n", + " 20003\n", + " MN DFL State Central Committee\n", + " PTU\n", + " 76 Words\n", + " 2500.00\n", " 0.0\n", - " 10/10/2015\n", - " 2015\n", - " Repayment of part of loan\n", - " Other Disbursement\n", + " 10/28/2022\n", + " 2022\n", + " Production, Radio\n", + " Independent Expenditure\n", " No\n", " NaN\n", - " NaN\n", - " NaN\n", + " Walz, Tim Gov Committee\n", + " 18135.0\n", " \n", " \n", " 1\n", - " 16008\n", - " Faust, Timothy D House Committee\n", - " PCC\n", - " Kanabec Publications\n", - " 429.11\n", + " 20003\n", + " MN DFL State Central Committee\n", + " PTU\n", + " 76 Words\n", + " 2500.00\n", " 0.0\n", - " 02/18/2015\n", - " 2015\n", - " Advertising - Print: $4.96 was service charge ...\n", - " Campaign Expenditure\n", + " 10/28/2022\n", + " 2022\n", + " Production, Radio\n", + " Independent Expenditure\n", " No\n", " NaN\n", - " NaN\n", - " NaN\n", + " Walz, Tim Gov Committee\n", + " 18135.0\n", " \n", " \n", " 2\n", - " 16248\n", - " Swails, Marsha G House Committee\n", - " PCC\n", - " NaN\n", - " 1293.77\n", + " 20003\n", + " MN DFL State Central Committee\n", + " PTU\n", + " 76 Words\n", + " 2500.00\n", " 0.0\n", - " 03/25/2015\n", - " 2015\n", - " NaN\n", - " Contribution\n", + " 10/28/2022\n", + " 2022\n", + " Production, Radio\n", + " Independent Expenditure\n", " No\n", " NaN\n", - " womenwinning State PAC\n", - " 40268.0\n", + " Walz, Tim Gov Committee\n", + " 18135.0\n", " \n", " \n", " 3\n", - " 16248\n", - " Swails, Marsha G House Committee\n", - " PCC\n", - " Women Candidate Development Coalition\n", - " 1293.76\n", + " 20003\n", + " MN DFL State Central Committee\n", + " PTU\n", + " 76 Words\n", + " 2500.00\n", " 0.0\n", - " 03/25/2015\n", - " 2015\n", - " contribution to non-profit\n", - " Other Disbursement\n", + " 10/28/2022\n", + " 2022\n", + " Production, Radio\n", + " Independent Expenditure\n", " No\n", " NaN\n", - " NaN\n", - " NaN\n", + " Walz, Tim Gov Committee\n", + " 18135.0\n", " \n", " \n", " 4\n", - " 16276\n", - " Sawatzke, Pat Senate Committee\n", - " PCC\n", - " UND Foundation\n", - " 500.00\n", + " 20003\n", + " MN DFL State Central Committee\n", + " PTU\n", + " 76 Words\n", + " 2500.00\n", " 0.0\n", - " 07/30/2015\n", - " 2015\n", - " charitable contribution\n", - " Other Disbursement\n", + " 10/28/2022\n", + " 2022\n", + " Production, Radio\n", + " Independent Expenditure\n", " No\n", " NaN\n", - " NaN\n", - " NaN\n", + " Walz, Tim Gov Committee\n", + " 18135.0\n", " \n", " \n", " ...\n", @@ -5840,24 +7731,24 @@ " ...\n", " \n", " \n", - " 664185\n", + " 441858\n", " 80026\n", " MN Assoc of Professional Employees Political Fund\n", " PCF\n", " MN Association of Professional Employees\n", - " 304.28\n", + " 163.34\n", " 0.0\n", - " 10/21/2020\n", + " 10/28/2020\n", " 2020\n", " Employee Expense: Staff costs\n", " Independent Expenditure\n", " No\n", " NaN\n", - " Isaacson, Jason (Ike) Senate Committee\n", - " 17929.0\n", + " Kent, Susan Senate Committee\n", + " 17443.0\n", " \n", " \n", - " 664186\n", + " 441859\n", " 80026\n", " MN Assoc of Professional Employees Political Fund\n", " PCF\n", @@ -5870,16 +7761,16 @@ " Independent Expenditure\n", " No\n", " NaN\n", - " Newton, Jerry Senate Committee\n", - " 18004.0\n", + " Bayley, Lisa Pritchard House Committee\n", + " 17933.0\n", " \n", " \n", - " 664187\n", + " 441860\n", " 80026\n", " MN Assoc of Professional Employees Political Fund\n", " PCF\n", " No Coast Workshop\n", - " 217.40\n", + " 217.39\n", " 0.0\n", " 10/13/2016\n", " 2016\n", @@ -5887,11 +7778,11 @@ " Independent Expenditure\n", " No\n", " NaN\n", - " Calvert, Deborah (Deb) Senate Committee\n", - " 18032.0\n", + " Ward, JoAnn House Committee\n", + " 17438.0\n", " \n", " \n", - " 664188\n", + " 441861\n", " 80026\n", " MN Assoc of Professional Employees Political Fund\n", " PCF\n", @@ -5904,11 +7795,11 @@ " Independent Expenditure\n", " No\n", " NaN\n", - " Maye Quade, Erin House Committee\n", - " 17885.0\n", + " Koenen, Lyle J Senate Committee\n", + " 17407.0\n", " \n", " \n", - " 664189\n", + " 441862\n", " 80026\n", " MN Assoc of Professional Employees Political Fund\n", " PCF\n", @@ -5921,97 +7812,97 @@ " Independent Expenditure\n", " No\n", " NaN\n", - " Witt, Susan D House Committee\n", - " 17723.0\n", + " Pryor, Laurie House Committee\n", + " 18031.0\n", " \n", " \n", "\n", - "

664190 rows × 14 columns

\n", + "

441863 rows × 14 columns

\n", "
" ], "text/plain": [ " SpenderRegNum SpenderName \\\n", - "0 15863 Hooten, Carol Dist Court Committee \n", - "1 16008 Faust, Timothy D House Committee \n", - "2 16248 Swails, Marsha G House Committee \n", - "3 16248 Swails, Marsha G House Committee \n", - "4 16276 Sawatzke, Pat Senate Committee \n", + "0 20003 MN DFL State Central Committee \n", + "1 20003 MN DFL State Central Committee \n", + "2 20003 MN DFL State Central Committee \n", + "3 20003 MN DFL State Central Committee \n", + "4 20003 MN DFL State Central Committee \n", "... ... ... \n", - "664185 80026 MN Assoc of Professional Employees Political Fund \n", - "664186 80026 MN Assoc of Professional Employees Political Fund \n", - "664187 80026 MN Assoc of Professional Employees Political Fund \n", - "664188 80026 MN Assoc of Professional Employees Political Fund \n", - "664189 80026 MN Assoc of Professional Employees Political Fund \n", + "441858 80026 MN Assoc of Professional Employees Political Fund \n", + "441859 80026 MN Assoc of Professional Employees Political Fund \n", + "441860 80026 MN Assoc of Professional Employees Political Fund \n", + "441861 80026 MN Assoc of Professional Employees Political Fund \n", + "441862 80026 MN Assoc of Professional Employees Political Fund \n", "\n", " SpenderType VendorName Amount \\\n", - "0 PCC NaN 102.84 \n", - "1 PCC Kanabec Publications 429.11 \n", - "2 PCC NaN 1293.77 \n", - "3 PCC Women Candidate Development Coalition 1293.76 \n", - "4 PCC UND Foundation 500.00 \n", + "0 PTU 76 Words 2500.00 \n", + "1 PTU 76 Words 2500.00 \n", + "2 PTU 76 Words 2500.00 \n", + "3 PTU 76 Words 2500.00 \n", + "4 PTU 76 Words 2500.00 \n", "... ... ... ... \n", - "664185 PCF MN Association of Professional Employees 304.28 \n", - "664186 PCF No Coast Workshop 217.39 \n", - "664187 PCF No Coast Workshop 217.40 \n", - "664188 PCF No Coast Workshop 144.32 \n", - "664189 PCF No Coast Workshop 144.33 \n", + "441858 PCF MN Association of Professional Employees 163.34 \n", + "441859 PCF No Coast Workshop 217.39 \n", + "441860 PCF No Coast Workshop 217.39 \n", + "441861 PCF No Coast Workshop 144.32 \n", + "441862 PCF No Coast Workshop 144.33 \n", "\n", " UnpaidAmount Date Year \\\n", - "0 0.0 10/10/2015 2015 \n", - "1 0.0 02/18/2015 2015 \n", - "2 0.0 03/25/2015 2015 \n", - "3 0.0 03/25/2015 2015 \n", - "4 0.0 07/30/2015 2015 \n", + "0 0.0 10/28/2022 2022 \n", + "1 0.0 10/28/2022 2022 \n", + "2 0.0 10/28/2022 2022 \n", + "3 0.0 10/28/2022 2022 \n", + "4 0.0 10/28/2022 2022 \n", "... ... ... ... \n", - "664185 0.0 10/21/2020 2020 \n", - "664186 0.0 10/13/2016 2016 \n", - "664187 0.0 10/13/2016 2016 \n", - "664188 0.0 11/03/2016 2016 \n", - "664189 0.0 11/03/2016 2016 \n", + "441858 0.0 10/28/2020 2020 \n", + "441859 0.0 10/13/2016 2016 \n", + "441860 0.0 10/13/2016 2016 \n", + "441861 0.0 11/03/2016 2016 \n", + "441862 0.0 11/03/2016 2016 \n", "\n", " Purpose \\\n", - "0 Repayment of part of loan \n", - "1 Advertising - Print: $4.96 was service charge ... \n", - "2 NaN \n", - "3 contribution to non-profit \n", - "4 charitable contribution \n", + "0 Production, Radio \n", + "1 Production, Radio \n", + "2 Production, Radio \n", + "3 Production, Radio \n", + "4 Production, Radio \n", "... ... \n", - "664185 Employee Expense: Staff costs \n", - "664186 Printing and Photocopying: Independent Expendi... \n", - "664187 Printing and Photocopying: Independent Expendi... \n", - "664188 Postage/ Delivery: Independent Expenditure Mai... \n", - "664189 Postage/ Delivery: Independent Expenditure Mai... \n", + "441858 Employee Expense: Staff costs \n", + "441859 Printing and Photocopying: Independent Expendi... \n", + "441860 Printing and Photocopying: Independent Expendi... \n", + "441861 Postage/ Delivery: Independent Expenditure Mai... \n", + "441862 Postage/ Delivery: Independent Expenditure Mai... \n", "\n", " Type In-kind? InKindDescription \\\n", - "0 Other Disbursement No NaN \n", - "1 Campaign Expenditure No NaN \n", - "2 Contribution No NaN \n", - "3 Other Disbursement No NaN \n", - "4 Other Disbursement No NaN \n", + "0 Independent Expenditure No NaN \n", + "1 Independent Expenditure No NaN \n", + "2 Independent Expenditure No NaN \n", + "3 Independent Expenditure No NaN \n", + "4 Independent Expenditure No NaN \n", "... ... ... ... \n", - "664185 Independent Expenditure No NaN \n", - "664186 Independent Expenditure No NaN \n", - "664187 Independent Expenditure No NaN \n", - "664188 Independent Expenditure No NaN \n", - "664189 Independent Expenditure No NaN \n", + "441858 Independent Expenditure No NaN \n", + "441859 Independent Expenditure No NaN \n", + "441860 Independent Expenditure No NaN \n", + "441861 Independent Expenditure No NaN \n", + "441862 Independent Expenditure No NaN \n", "\n", - " AffectedCommitteeName AffectedCommitteeRegNum \n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 womenwinning State PAC 40268.0 \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - "... ... ... \n", - "664185 Isaacson, Jason (Ike) Senate Committee 17929.0 \n", - "664186 Newton, Jerry Senate Committee 18004.0 \n", - "664187 Calvert, Deborah (Deb) Senate Committee 18032.0 \n", - "664188 Maye Quade, Erin House Committee 17885.0 \n", - "664189 Witt, Susan D House Committee 17723.0 \n", + " AffectedCommitteeName AffectedCommitteeRegNum \n", + "0 Walz, Tim Gov Committee 18135.0 \n", + "1 Walz, Tim Gov Committee 18135.0 \n", + "2 Walz, Tim Gov Committee 18135.0 \n", + "3 Walz, Tim Gov Committee 18135.0 \n", + "4 Walz, Tim Gov Committee 18135.0 \n", + "... ... ... \n", + "441858 Kent, Susan Senate Committee 17443.0 \n", + "441859 Bayley, Lisa Pritchard House Committee 17933.0 \n", + "441860 Ward, JoAnn House Committee 17438.0 \n", + "441861 Koenen, Lyle J Senate Committee 17407.0 \n", + "441862 Pryor, Laurie House Committee 18031.0 \n", "\n", - "[664190 rows x 14 columns]" + "[441863 rows x 14 columns]" ] }, - "execution_count": 8, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -6022,24 +7913,19 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "['PCC' 'PCF' 'PTU']\n", - "['Other Disbursement' 'Campaign Expenditure' 'Contribution'\n", - " 'Non-Campaign Disbursement' 'General Expenditure'\n", - " 'Ballot Question Expenditure' 'Party Unit' 'Candidate Committee'\n", - " 'Political Committee/Fund' 'Independent Expenditure']\n" + "['PTU' 'PCF']\n" ] } ], "source": [ - "print(df_expenditure['SpenderType'].unique())\n", - "print(df_expenditure['Type'].unique())" + "print(df_expenditure['SpenderType'].unique())" ] }, { @@ -6051,30 +7937,30 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "SpenderRegNum 0\n", - "SpenderName 81\n", + "SpenderName 0\n", "SpenderType 0\n", - "VendorName 38386\n", + "VendorName 605\n", "Amount 0\n", "UnpaidAmount 0\n", "Date 0\n", "Year 0\n", - "Purpose 66290\n", + "Purpose 22801\n", "Type 0\n", "In-kind? 0\n", - "InKindDescription 639990\n", - "AffectedCommitteeName 236995\n", - "AffectedCommitteeRegNum 236693\n", + "InKindDescription 437803\n", + "AffectedCommitteeName 11151\n", + "AffectedCommitteeRegNum 11146\n", "dtype: int64" ] }, - "execution_count": 10, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -6085,17 +7971,17 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Total number of expenditure entries = 664190\n", - "Total number of nonclassifiable expenditure amount = 355\n", - "Total number of nonclassifiable spenders = 81\n", - "Proportion of nonclassifiable entries = 0.0656%\n" + "Total number of expenditure entries = 441863\n", + "Total number of nonclassifiable expenditure amount = 306\n", + "Total number of nonclassifiable spenders = 0\n", + "Proportion of nonclassifiable entries = 0.0693%\n" ] } ], @@ -6112,33 +7998,42 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_56567/3446921023.py:2: DeprecationWarning: Call to deprecated function drop_nonclassifiable_expenditure.\n", + " df_expenditure = drop_nonclassifiable_expenditure(df_expenditure)\n" + ] + } + ], "source": [ - "from utils.MN_util import drop_nonclassifiable_exp\n", - "df_expenditure = drop_nonclassifiable_exp(df_expenditure)" + "from utils.MN_util import drop_nonclassifiable_expenditure\n", + "df_expenditure = drop_nonclassifiable_expenditure(df_expenditure)" ] }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Year\n", - "2018 1.379913e+08\n", - "2019 2.612436e+07\n", - "2020 1.113496e+08\n", - "2021 2.680744e+07\n", - "2022 2.799756e+09\n", - "2023 4.155524e+06\n", + "2018 3.313543e+07\n", + "2019 8.444989e+05\n", + "2020 1.088950e+08\n", + "2021 3.822523e+05\n", + "2022 2.761982e+09\n", + "2023 2.746372e+06\n", "Name: Amount, dtype: float64" ] }, - "execution_count": 13, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -6165,7 +8060,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -6178,7 +8073,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -6211,362 +8106,314 @@ " \n", " 0\n", " 2018\n", - " MN DFL State Central Committee\n", - " 1.634667e+07\n", + " Alliance for a Better Minnesota Action Fund\n", + " 8.425909e+06\n", " \n", " \n", " 1\n", " 2018\n", - " Alliance for a Better Minnesota Action Fund\n", - " 9.388784e+06\n", + " MN DFL State Central Committee\n", + " 4.856272e+06\n", " \n", " \n", " 2\n", " 2018\n", - " DGA Victory Fund\n", - " 7.639284e+06\n", + " MN Victory PAC\n", + " 3.331147e+06\n", " \n", " \n", " 3\n", " 2018\n", - " 2024 Fund\n", - " 5.702886e+06\n", + " HRCC\n", + " 2.016482e+06\n", " \n", " \n", " 4\n", " 2018\n", - " DFL House Caucus\n", - " 5.409447e+06\n", + " Freedom Club State PAC\n", + " 1.852156e+06\n", " \n", " \n", " 5\n", " 2018\n", - " Education Minn PAC\n", - " 5.224434e+06\n", + " DFL House Caucus\n", + " 1.513452e+06\n", " \n", " \n", " 6\n", " 2018\n", - " Walz, Tim Gov Committee\n", - " 4.608298e+06\n", + " Pro Jobs Majority\n", + " 1.395251e+06\n", " \n", " \n", " 7\n", " 2018\n", - " MN Victory PAC\n", - " 3.785053e+06\n", + " MN Jobs Coalition Legislative Fund\n", + " 1.372963e+06\n", " \n", " \n", " 8\n", " 2018\n", - " WIN Minnesota Political Action Fund\n", - " 3.263076e+06\n", + " Coalition of Minnesota Businesses IEPC\n", + " 8.758362e+05\n", " \n", " \n", " 9\n", " 2018\n", - " HRCC\n", - " 3.079447e+06\n", + " Housing First Fund\n", + " 8.530283e+05\n", " \n", " \n", " 10\n", " 2019\n", " MN DFL State Central Committee\n", - " 3.582806e+06\n", + " 4.473529e+05\n", " \n", " \n", " 11\n", " 2019\n", - " DGA Victory Fund\n", - " 2.554925e+06\n", + " Advance Minnesota Independent Expenditure Comm...\n", + " 1.026880e+05\n", " \n", " \n", " 12\n", " 2019\n", - " Deloitte Political Action Committee\n", - " 2.316457e+06\n", + " Coalition of Minnesota Businesses IEPC\n", + " 8.046022e+04\n", " \n", " \n", " 13\n", " 2019\n", - " Education Minn PAC\n", - " 1.066196e+06\n", + " Senate Victory Fund (SVF)\n", + " 4.077900e+04\n", " \n", " \n", " 14\n", " 2019\n", - " DFL Senate Caucus\n", - " 8.271695e+05\n", + " Right Now Minnesota\n", + " 3.890146e+04\n", " \n", " \n", " 15\n", " 2019\n", - " Republican Party of Minn\n", - " 7.829564e+05\n", + " Alliance for a Better Minnesota Action Fund\n", + " 3.358908e+04\n", " \n", " \n", " 16\n", " 2019\n", - " DFL House Caucus\n", - " 6.504046e+05\n", + " Republican Party of Minn\n", + " 3.298655e+04\n", " \n", " \n", " 17\n", " 2019\n", - " HRCC\n", - " 6.390662e+05\n", + " Win at the Door PAC\n", + " 2.585051e+04\n", " \n", " \n", " 18\n", " 2019\n", - " Senate Victory Fund (SVF)\n", - " 6.190183e+05\n", + " Planned Parenthood of Minn Pol Action Fund\n", + " 1.400514e+04\n", " \n", " \n", " 19\n", " 2019\n", - " DLCC Victory Fund\n", - " 4.963511e+05\n", + " Housing First Fund\n", + " 9.000000e+03\n", " \n", " \n", " 20\n", " 2020\n", " MN DFL State Central Committee\n", - " 1.186727e+07\n", + " 2.875138e+07\n", " \n", " \n", " 21\n", " 2020\n", - " Alliance for a Better Minnesota Action Fund\n", - " 7.422896e+06\n", + " DFL House Caucus\n", + " 1.914924e+07\n", " \n", " \n", " 22\n", " 2020\n", - " DFL Senate Caucus\n", - " 7.156607e+06\n", + " Alliance for a Better Minnesota Action Fund\n", + " 1.165052e+07\n", " \n", " \n", " 23\n", " 2020\n", - " DFL House Caucus\n", - " 6.292336e+06\n", + " HRCC\n", + " 8.943520e+06\n", " \n", " \n", " 24\n", " 2020\n", - " WIN Minnesota Political Action Fund\n", - " 5.211757e+06\n", + " Senate Victory Fund (SVF)\n", + " 8.658417e+06\n", " \n", " \n", " 25\n", " 2020\n", - " 2024 Fund\n", - " 4.862000e+06\n", + " DFL Senate Caucus\n", + " 6.625248e+06\n", " \n", " \n", " 26\n", " 2020\n", - " Senate Victory Fund (SVF)\n", - " 4.144662e+06\n", + " Advance Minnesota Independent Expenditure Comm...\n", + " 3.480636e+06\n", " \n", " \n", " 27\n", " 2020\n", - " Education Minn PAC\n", - " 3.919966e+06\n", + " Freedom Club State PAC\n", + " 1.869632e+06\n", " \n", " \n", " 28\n", " 2020\n", - " SEIU Minn State Council Political Fund\n", - " 2.728316e+06\n", + " Planned Parenthood of Minn Pol Action Fund\n", + " 1.788499e+06\n", " \n", " \n", " 29\n", " 2020\n", - " DGA Victory Fund\n", - " 2.432946e+06\n", + " Everytown for Gun Safety Action Fund\n", + " 1.729842e+06\n", " \n", " \n", " 30\n", " 2021\n", - " MN DFL State Central Committee\n", - " 4.348914e+06\n", + " Plan for Progress\n", + " 2.306310e+05\n", " \n", " \n", " 31\n", " 2021\n", - " Plan for Progress\n", - " 1.382791e+06\n", + " MN Realtors Political Action Committee\n", + " 1.329537e+05\n", " \n", " \n", " 32\n", " 2021\n", - " Education Minn PAC\n", - " 1.360038e+06\n", + " Planned Parenthood of Minn Pol Action Fund\n", + " 1.024660e+04\n", " \n", " \n", " 33\n", " 2021\n", - " Walz, Tim Gov Committee\n", - " 1.324421e+06\n", + " MN Homeowners Alliance Independent Expenditure...\n", + " 7.671000e+03\n", " \n", " \n", " 34\n", " 2021\n", - " Deloitte Political Action Committee\n", - " 1.284125e+06\n", + " Carpenters Local 322\n", + " 7.500000e+02\n", " \n", " \n", " 35\n", - " 2021\n", - " DFL Senate Caucus\n", - " 6.201821e+05\n", - " \n", - " \n", - " 36\n", - " 2021\n", - " MN State Council of UNITE HERE Unions\n", - " 6.034500e+05\n", - " \n", - " \n", - " 37\n", - " 2021\n", - " Republican Party of Minn\n", - " 5.811059e+05\n", - " \n", - " \n", - " 38\n", - " 2021\n", - " DFL House Caucus\n", - " 5.769969e+05\n", - " \n", - " \n", - " 39\n", - " 2021\n", - " DGA Victory Fund\n", - " 5.041542e+05\n", - " \n", - " \n", - " 40\n", " 2022\n", " MN DFL State Central Committee\n", - " 5.299254e+08\n", + " 5.595062e+08\n", " \n", " \n", - " 41\n", + " 36\n", " 2022\n", " Alliance for a Better Minnesota Action Fund\n", - " 4.077091e+08\n", + " 4.210824e+08\n", " \n", " \n", - " 42\n", + " 37\n", " 2022\n", " DFL House Caucus\n", - " 2.187665e+08\n", + " 2.336432e+08\n", " \n", " \n", - " 43\n", + " 38\n", " 2022\n", " MN for Freedom\n", - " 1.541938e+08\n", + " 1.594200e+08\n", " \n", " \n", - " 44\n", + " 39\n", " 2022\n", " Safe Accessible Fair Elections Minnesota\n", - " 1.314013e+08\n", + " 1.346198e+08\n", " \n", " \n", - " 45\n", + " 40\n", " 2022\n", " DAGA MN People's Lawyer Project\n", - " 1.109658e+08\n", + " 1.128677e+08\n", " \n", " \n", - " 46\n", + " 41\n", " 2022\n", - " Advance Minnesota Independent Expenditure Comm...\n", - " 9.911244e+07\n", + " HRCC\n", + " 1.014986e+08\n", " \n", " \n", - " 47\n", + " 42\n", " 2022\n", - " HRCC\n", - " 9.192176e+07\n", + " Advance Minnesota Independent Expenditure Comm...\n", + " 1.011120e+08\n", " \n", " \n", - " 48\n", + " 43\n", " 2022\n", " MN Jobs Coalition Legislative Fund\n", - " 9.078141e+07\n", + " 9.271635e+07\n", " \n", " \n", - " 49\n", + " 44\n", " 2022\n", " iVote Fund MN\n", - " 7.980807e+07\n", + " 8.180324e+07\n", " \n", " \n", - " 50\n", + " 45\n", " 2023\n", " All of Mpls\n", - " 6.872487e+05\n", - " \n", - " \n", - " 51\n", - " 2023\n", - " Laborers District Council of Minn & ND Pol Fund\n", - " 4.739393e+05\n", - " \n", - " \n", - " 52\n", - " 2023\n", - " North Central States Carpenters PAC\n", - " 4.647250e+05\n", + " 1.410424e+06\n", " \n", " \n", - " 53\n", + " 46\n", " 2023\n", " TakeAction Political Fund\n", - " 4.630456e+05\n", - " \n", - " \n", - " 54\n", - " 2023\n", - " AFSCME Council 5 PEOPLE Fund\n", - " 2.176542e+05\n", + " 7.931047e+05\n", " \n", " \n", - " 55\n", + " 47\n", " 2023\n", - " Sheet Metal Workers PAC 10\n", - " 1.817000e+05\n", + " Minneapolis for the Many\n", + " 2.365442e+05\n", " \n", " \n", - " 56\n", + " 48\n", " 2023\n", - " Joint Council 32 DRIVE\n", - " 1.603323e+05\n", + " Laborers District Council of Minn & ND Pol Fund\n", + " 1.541600e+05\n", " \n", " \n", - " 57\n", + " 49\n", " 2023\n", - " IBEW Local 292 Political Education Fund\n", - " 1.378147e+05\n", + " Minneapolis Regional Labor Federation\n", + " 1.200286e+05\n", " \n", " \n", - " 58\n", + " 50\n", " 2023\n", - " MN State Bldg & Construction Trades Cncl Pol Fund\n", - " 1.251500e+05\n", + " Faith in Minnesota Fund\n", + " 3.046350e+04\n", " \n", " \n", - " 59\n", + " 51\n", " 2023\n", - " International Union of Operating Engineers\n", - " 1.212000e+05\n", + " Move Minnesota Action Fund\n", + " 1.647280e+03\n", " \n", " \n", "\n", @@ -6574,69 +8421,61 @@ ], "text/plain": [ " Year SpenderName Amount\n", - "0 2018 MN DFL State Central Committee 1.634667e+07\n", - "1 2018 Alliance for a Better Minnesota Action Fund 9.388784e+06\n", - "2 2018 DGA Victory Fund 7.639284e+06\n", - "3 2018 2024 Fund 5.702886e+06\n", - "4 2018 DFL House Caucus 5.409447e+06\n", - "5 2018 Education Minn PAC 5.224434e+06\n", - "6 2018 Walz, Tim Gov Committee 4.608298e+06\n", - "7 2018 MN Victory PAC 3.785053e+06\n", - "8 2018 WIN Minnesota Political Action Fund 3.263076e+06\n", - "9 2018 HRCC 3.079447e+06\n", - "10 2019 MN DFL State Central Committee 3.582806e+06\n", - "11 2019 DGA Victory Fund 2.554925e+06\n", - "12 2019 Deloitte Political Action Committee 2.316457e+06\n", - "13 2019 Education Minn PAC 1.066196e+06\n", - "14 2019 DFL Senate Caucus 8.271695e+05\n", - "15 2019 Republican Party of Minn 7.829564e+05\n", - "16 2019 DFL House Caucus 6.504046e+05\n", - "17 2019 HRCC 6.390662e+05\n", - "18 2019 Senate Victory Fund (SVF) 6.190183e+05\n", - "19 2019 DLCC Victory Fund 4.963511e+05\n", - "20 2020 MN DFL State Central Committee 1.186727e+07\n", - "21 2020 Alliance for a Better Minnesota Action Fund 7.422896e+06\n", - "22 2020 DFL Senate Caucus 7.156607e+06\n", - "23 2020 DFL House Caucus 6.292336e+06\n", - "24 2020 WIN Minnesota Political Action Fund 5.211757e+06\n", - "25 2020 2024 Fund 4.862000e+06\n", - "26 2020 Senate Victory Fund (SVF) 4.144662e+06\n", - "27 2020 Education Minn PAC 3.919966e+06\n", - "28 2020 SEIU Minn State Council Political Fund 2.728316e+06\n", - "29 2020 DGA Victory Fund 2.432946e+06\n", - "30 2021 MN DFL State Central Committee 4.348914e+06\n", - "31 2021 Plan for Progress 1.382791e+06\n", - "32 2021 Education Minn PAC 1.360038e+06\n", - "33 2021 Walz, Tim Gov Committee 1.324421e+06\n", - "34 2021 Deloitte Political Action Committee 1.284125e+06\n", - "35 2021 DFL Senate Caucus 6.201821e+05\n", - "36 2021 MN State Council of UNITE HERE Unions 6.034500e+05\n", - "37 2021 Republican Party of Minn 5.811059e+05\n", - "38 2021 DFL House Caucus 5.769969e+05\n", - "39 2021 DGA Victory Fund 5.041542e+05\n", - "40 2022 MN DFL State Central Committee 5.299254e+08\n", - "41 2022 Alliance for a Better Minnesota Action Fund 4.077091e+08\n", - "42 2022 DFL House Caucus 2.187665e+08\n", - "43 2022 MN for Freedom 1.541938e+08\n", - "44 2022 Safe Accessible Fair Elections Minnesota 1.314013e+08\n", - "45 2022 DAGA MN People's Lawyer Project 1.109658e+08\n", - "46 2022 Advance Minnesota Independent Expenditure Comm... 9.911244e+07\n", - "47 2022 HRCC 9.192176e+07\n", - "48 2022 MN Jobs Coalition Legislative Fund 9.078141e+07\n", - "49 2022 iVote Fund MN 7.980807e+07\n", - "50 2023 All of Mpls 6.872487e+05\n", - "51 2023 Laborers District Council of Minn & ND Pol Fund 4.739393e+05\n", - "52 2023 North Central States Carpenters PAC 4.647250e+05\n", - "53 2023 TakeAction Political Fund 4.630456e+05\n", - "54 2023 AFSCME Council 5 PEOPLE Fund 2.176542e+05\n", - "55 2023 Sheet Metal Workers PAC 10 1.817000e+05\n", - "56 2023 Joint Council 32 DRIVE 1.603323e+05\n", - "57 2023 IBEW Local 292 Political Education Fund 1.378147e+05\n", - "58 2023 MN State Bldg & Construction Trades Cncl Pol Fund 1.251500e+05\n", - "59 2023 International Union of Operating Engineers 1.212000e+05" + "0 2018 Alliance for a Better Minnesota Action Fund 8.425909e+06\n", + "1 2018 MN DFL State Central Committee 4.856272e+06\n", + "2 2018 MN Victory PAC 3.331147e+06\n", + "3 2018 HRCC 2.016482e+06\n", + "4 2018 Freedom Club State PAC 1.852156e+06\n", + "5 2018 DFL House Caucus 1.513452e+06\n", + "6 2018 Pro Jobs Majority 1.395251e+06\n", + "7 2018 MN Jobs Coalition Legislative Fund 1.372963e+06\n", + "8 2018 Coalition of Minnesota Businesses IEPC 8.758362e+05\n", + "9 2018 Housing First Fund 8.530283e+05\n", + "10 2019 MN DFL State Central Committee 4.473529e+05\n", + "11 2019 Advance Minnesota Independent Expenditure Comm... 1.026880e+05\n", + "12 2019 Coalition of Minnesota Businesses IEPC 8.046022e+04\n", + "13 2019 Senate Victory Fund (SVF) 4.077900e+04\n", + "14 2019 Right Now Minnesota 3.890146e+04\n", + "15 2019 Alliance for a Better Minnesota Action Fund 3.358908e+04\n", + "16 2019 Republican Party of Minn 3.298655e+04\n", + "17 2019 Win at the Door PAC 2.585051e+04\n", + "18 2019 Planned Parenthood of Minn Pol Action Fund 1.400514e+04\n", + "19 2019 Housing First Fund 9.000000e+03\n", + "20 2020 MN DFL State Central Committee 2.875138e+07\n", + "21 2020 DFL House Caucus 1.914924e+07\n", + "22 2020 Alliance for a Better Minnesota Action Fund 1.165052e+07\n", + "23 2020 HRCC 8.943520e+06\n", + "24 2020 Senate Victory Fund (SVF) 8.658417e+06\n", + "25 2020 DFL Senate Caucus 6.625248e+06\n", + "26 2020 Advance Minnesota Independent Expenditure Comm... 3.480636e+06\n", + "27 2020 Freedom Club State PAC 1.869632e+06\n", + "28 2020 Planned Parenthood of Minn Pol Action Fund 1.788499e+06\n", + "29 2020 Everytown for Gun Safety Action Fund 1.729842e+06\n", + "30 2021 Plan for Progress 2.306310e+05\n", + "31 2021 MN Realtors Political Action Committee 1.329537e+05\n", + "32 2021 Planned Parenthood of Minn Pol Action Fund 1.024660e+04\n", + "33 2021 MN Homeowners Alliance Independent Expenditure... 7.671000e+03\n", + "34 2021 Carpenters Local 322 7.500000e+02\n", + "35 2022 MN DFL State Central Committee 5.595062e+08\n", + "36 2022 Alliance for a Better Minnesota Action Fund 4.210824e+08\n", + "37 2022 DFL House Caucus 2.336432e+08\n", + "38 2022 MN for Freedom 1.594200e+08\n", + "39 2022 Safe Accessible Fair Elections Minnesota 1.346198e+08\n", + "40 2022 DAGA MN People's Lawyer Project 1.128677e+08\n", + "41 2022 HRCC 1.014986e+08\n", + "42 2022 Advance Minnesota Independent Expenditure Comm... 1.011120e+08\n", + "43 2022 MN Jobs Coalition Legislative Fund 9.271635e+07\n", + "44 2022 iVote Fund MN 8.180324e+07\n", + "45 2023 All of Mpls 1.410424e+06\n", + "46 2023 TakeAction Political Fund 7.931047e+05\n", + "47 2023 Minneapolis for the Many 2.365442e+05\n", + "48 2023 Laborers District Council of Minn & ND Pol Fund 1.541600e+05\n", + "49 2023 Minneapolis Regional Labor Federation 1.200286e+05\n", + "50 2023 Faith in Minnesota Fund 3.046350e+04\n", + "51 2023 Move Minnesota Action Fund 1.647280e+03" ] }, - "execution_count": 15, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -6654,7 +8493,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -6667,7 +8506,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -6706,426 +8545,412 @@ " \n", " 1\n", " 2018\n", - " Democratic Governors Association\n", - " 5.096131e+06\n", + " Clarify Agency\n", + " 3.904962e+06\n", " \n", " \n", " 2\n", " 2018\n", - " Clarify Agency\n", - " 4.289870e+06\n", + " Nebo Media\n", + " 3.017132e+06\n", " \n", " \n", " 3\n", " 2018\n", - " Nebo Media\n", - " 3.538082e+06\n", + " Berlin Rosen LTD\n", + " 1.425687e+06\n", " \n", " \n", " 4\n", " 2018\n", - " Drake Bank Federal\n", - " 3.040606e+06\n", + " Ax Media\n", + " 1.370301e+06\n", " \n", " \n", " 5\n", " 2018\n", - " GMMB Inc\n", - " 2.512423e+06\n", + " Sage Media Planning Placement\n", + " 9.975067e+05\n", " \n", " \n", " 6\n", " 2018\n", - " Berlin Rosen LTD\n", - " 1.446830e+06\n", + " Larry John Wright Advertising Inc\n", + " 8.335000e+05\n", " \n", " \n", " 7\n", " 2018\n", - " Ax Media\n", - " 1.370301e+06\n", + " Gumbinner Davies\n", + " 7.910048e+05\n", " \n", " \n", " 8\n", " 2018\n", - " Strategic Media for Placement\n", - " 1.326959e+06\n", + " Targeted CreativeCommunication\n", + " 6.808424e+05\n", " \n", " \n", " 9\n", " 2018\n", - " Education Minnesota\n", - " 1.302605e+06\n", + " E Street Group LLC\n", + " 6.327749e+05\n", " \n", " \n", " 10\n", " 2019\n", - " Democratic Governors Association - Mississippi\n", - " 2.434730e+06\n", + " Canal Partners Media\n", + " 3.626000e+05\n", " \n", " \n", " 11\n", " 2019\n", - " Drake Bank Federal\n", - " 1.060554e+06\n", + " Berlin Rosen LTD\n", + " 6.373017e+04\n", " \n", " \n", " 12\n", " 2019\n", - " Republican Party of Minnesota - Federal Account\n", - " 4.960728e+05\n", + " Nebo Media\n", + " 5.850000e+04\n", " \n", " \n", " 13\n", " 2019\n", - " Canal Partners Media\n", - " 3.626000e+05\n", + " Majority Strategies\n", + " 5.400000e+04\n", " \n", " \n", " 14\n", " 2019\n", - " SEIU MN State Council\n", - " 3.363778e+05\n", + " Weber Johnson Public Affairs\n", + " 4.471800e+04\n", " \n", " \n", " 15\n", " 2019\n", - " Western Bank\n", - " 3.161543e+05\n", + " Front Runner Digital\n", + " 3.847900e+04\n", " \n", " \n", " 16\n", " 2019\n", - " Pinnacle Direct\n", - " 2.952088e+05\n", + " Clarify Agency\n", + " 3.158908e+04\n", " \n", " \n", " 17\n", " 2019\n", - " Seven Corners Printing\n", - " 2.412480e+05\n", + " Singularis\n", + " 2.251155e+04\n", " \n", " \n", " 18\n", " 2019\n", - " EFTPS Fed Tax Payment\n", - " 1.835754e+05\n", + " AppNexus Inc\n", + " 1.951000e+04\n", " \n", " \n", " 19\n", " 2019\n", - " Perkins Coie LLP\n", - " 1.743259e+05\n", + " Connection Strategy LLC\n", + " 1.796022e+04\n", " \n", " \n", " 20\n", " 2020\n", " Clarify Agency\n", - " 5.621665e+06\n", + " 1.710700e+07\n", " \n", " \n", " 21\n", " 2020\n", - " Drake Bank Federal\n", - " 2.728263e+06\n", + " Canal Partners Media\n", + " 1.013758e+07\n", " \n", " \n", " 22\n", " 2020\n", - " Democratic Governors Association\n", - " 2.397500e+06\n", + " Sage Media Planning Placement\n", + " 9.441231e+06\n", " \n", " \n", " 23\n", " 2020\n", - " Left Hook\n", - " 2.380277e+06\n", + " Gumbinner Davies\n", + " 8.908617e+06\n", " \n", " \n", " 24\n", " 2020\n", - " WIN Minnesota Federal PAC\n", - " 2.220500e+06\n", + " FP1 Digital LLC\n", + " 7.931499e+06\n", " \n", " \n", " 25\n", " 2020\n", - " FP1 Digital LLC\n", - " 2.092333e+06\n", + " Blueprint Interactive\n", + " 5.614262e+06\n", " \n", " \n", " 26\n", " 2020\n", - " Canal Partners Media\n", - " 1.448225e+06\n", + " Berlin Rosen LTD\n", + " 4.278030e+06\n", " \n", " \n", " 27\n", " 2020\n", - " Sage Media Planning Placement\n", - " 1.375934e+06\n", + " Wildfire Mail\n", + " 3.743325e+06\n", " \n", " \n", " 28\n", " 2020\n", - " Gumbinner Davies\n", - " 1.272660e+06\n", + " Targeted CreativeCommunication\n", + " 3.461442e+06\n", " \n", " \n", " 29\n", " 2020\n", - " Education Minnesota\n", - " 1.008506e+06\n", + " Left Hook\n", + " 3.343557e+06\n", " \n", " \n", " 30\n", " 2021\n", - " Drake Bank Federal\n", - " 1.539032e+06\n", + " New Publica LLC\n", + " 2.006310e+05\n", " \n", " \n", " 31\n", " 2021\n", - " AllofMpls\n", - " 1.229037e+06\n", + " Real Strategies\n", + " 1.199037e+05\n", " \n", " \n", " 32\n", " 2021\n", - " Education Minnesota\n", - " 9.120825e+05\n", + " Eye Contact Media\n", + " 3.000000e+04\n", " \n", " \n", " 33\n", " 2021\n", - " Robin for Minneapolis\n", - " 6.014500e+05\n", + " (MN) Access Marketing\n", + " 1.305000e+04\n", " \n", " \n", " 34\n", " 2021\n", - " Cleansweep Campaigns\n", - " 4.226354e+05\n", + " Planned Parenthood MN ND SD Action Fund\n", + " 9.520600e+03\n", " \n", " \n", " 35\n", " 2021\n", - " Republican Party of Minnesota - Federal Account\n", - " 3.682714e+05\n", + " CliftonLarsonAllen\n", + " 7.671000e+03\n", " \n", " \n", " 36\n", " 2021\n", - " EFTPS Fed Tax Payment\n", - " 2.897723e+05\n", + " Minnesota Campaign Finance Board\n", + " 7.500000e+02\n", " \n", " \n", " 37\n", " 2021\n", - " McCool Digital LLC\n", - " 2.571873e+05\n", + " Facebook\n", + " 7.260000e+02\n", " \n", " \n", " 38\n", - " 2021\n", - " Yes 4 Minneapolis\n", - " 2.190000e+05\n", + " 2022\n", + " Clarify Agency\n", + " 2.831990e+08\n", " \n", " \n", " 39\n", - " 2021\n", - " Democratic Attorneys General Assocation Inc\n", - " 2.136878e+05\n", + " 2022\n", + " Great American Media\n", + " 2.675292e+08\n", " \n", " \n", " 40\n", " 2022\n", - " Clarify Agency\n", - " 2.647481e+08\n", + " Canal Partners Media\n", + " 1.777085e+08\n", " \n", " \n", " 41\n", " 2022\n", - " Great American Media\n", - " 2.582326e+08\n", + " Deliver Strategies\n", + " 1.184445e+08\n", " \n", " \n", " 42\n", " 2022\n", - " Canal Partners Media\n", - " 1.593249e+08\n", + " Berlin Rosen LTD\n", + " 1.128677e+08\n", " \n", " \n", " 43\n", " 2022\n", - " Berlin Rosen LTD\n", - " 1.105615e+08\n", + " Red Eagle Media\n", + " 1.118814e+08\n", " \n", " \n", " 44\n", " 2022\n", - " Red Eagle Media\n", - " 1.082093e+08\n", + " Sage Media Planning Placement\n", + " 9.786503e+07\n", " \n", " \n", " 45\n", " 2022\n", - " Deliver Strategies\n", - " 1.074506e+08\n", + " Nebo Media\n", + " 9.038561e+07\n", " \n", " \n", " 46\n", " 2022\n", - " Nebo Media\n", - " 8.849665e+07\n", + " FP1 Digital LLC\n", + " 8.575528e+07\n", " \n", " \n", " 47\n", " 2022\n", - " Sage Media Planning Placement\n", - " 8.776352e+07\n", + " Targeted Creative Communication\n", + " 8.388532e+07\n", " \n", " \n", " 48\n", - " 2022\n", - " FP1 Digital LLC\n", - " 8.138634e+07\n", + " 2023\n", + " GRSG Company\n", + " 1.007000e+06\n", " \n", " \n", " 49\n", - " 2022\n", - " Schultz, Jennifer House Committee\n", - " 8.054502e+07\n", + " 2023\n", + " The People's Canvass\n", + " 7.261599e+05\n", " \n", " \n", " 50\n", " 2023\n", - " MN DFL State Central Committee\n", - " 7.828450e+05\n", + " Eye Contact Media\n", + " 2.510000e+05\n", " \n", " \n", " 51\n", " 2023\n", - " GRSG Company\n", - " 5.000000e+05\n", + " Nordeast Digital\n", + " 1.600000e+05\n", " \n", " \n", " 52\n", " 2023\n", - " The People's Canvass\n", - " 4.230976e+05\n", + " Pivot Mailing\n", + " 1.073689e+05\n", " \n", " \n", " 53\n", " 2023\n", - " MN DFL Senate Caucus\n", - " 2.496439e+05\n", + " Printastik\n", + " 7.429610e+04\n", " \n", " \n", " 54\n", " 2023\n", - " MN DFL House Caucus\n", - " 2.427772e+05\n", + " Seven Corners Print and Promo\n", + " 7.181544e+04\n", " \n", " \n", " 55\n", " 2023\n", - " AGC of MN\n", - " 1.343460e+05\n", + " Apparatus\n", + " 6.426000e+04\n", " \n", " \n", " 56\n", " 2023\n", - " SMART PAL-Education\n", - " 1.200000e+05\n", + " Do-GoodBiz\n", + " 5.364402e+04\n", " \n", " \n", " 57\n", " 2023\n", - " Teamsters Joint Council 32\n", - " 8.893821e+04\n", - " \n", - " \n", - " 58\n", - " 2023\n", - " All of Mpls\n", - " 8.621453e+04\n", - " \n", - " \n", - " 59\n", - " 2023\n", - " Apparatus\n", - " 7.000000e+04\n", + " Postmaster\n", + " 4.603125e+04\n", " \n", " \n", "\n", "" ], "text/plain": [ - " Year VendorName Amount\n", - "0 2018 Great American Media 7.092650e+06\n", - "1 2018 Democratic Governors Association 5.096131e+06\n", - "2 2018 Clarify Agency 4.289870e+06\n", - "3 2018 Nebo Media 3.538082e+06\n", - "4 2018 Drake Bank Federal 3.040606e+06\n", - "5 2018 GMMB Inc 2.512423e+06\n", - "6 2018 Berlin Rosen LTD 1.446830e+06\n", - "7 2018 Ax Media 1.370301e+06\n", - "8 2018 Strategic Media for Placement 1.326959e+06\n", - "9 2018 Education Minnesota 1.302605e+06\n", - "10 2019 Democratic Governors Association - Mississippi 2.434730e+06\n", - "11 2019 Drake Bank Federal 1.060554e+06\n", - "12 2019 Republican Party of Minnesota - Federal Account 4.960728e+05\n", - "13 2019 Canal Partners Media 3.626000e+05\n", - "14 2019 SEIU MN State Council 3.363778e+05\n", - "15 2019 Western Bank 3.161543e+05\n", - "16 2019 Pinnacle Direct 2.952088e+05\n", - "17 2019 Seven Corners Printing 2.412480e+05\n", - "18 2019 EFTPS Fed Tax Payment 1.835754e+05\n", - "19 2019 Perkins Coie LLP 1.743259e+05\n", - "20 2020 Clarify Agency 5.621665e+06\n", - "21 2020 Drake Bank Federal 2.728263e+06\n", - "22 2020 Democratic Governors Association 2.397500e+06\n", - "23 2020 Left Hook 2.380277e+06\n", - "24 2020 WIN Minnesota Federal PAC 2.220500e+06\n", - "25 2020 FP1 Digital LLC 2.092333e+06\n", - "26 2020 Canal Partners Media 1.448225e+06\n", - "27 2020 Sage Media Planning Placement 1.375934e+06\n", - "28 2020 Gumbinner Davies 1.272660e+06\n", - "29 2020 Education Minnesota 1.008506e+06\n", - "30 2021 Drake Bank Federal 1.539032e+06\n", - "31 2021 AllofMpls 1.229037e+06\n", - "32 2021 Education Minnesota 9.120825e+05\n", - "33 2021 Robin for Minneapolis 6.014500e+05\n", - "34 2021 Cleansweep Campaigns 4.226354e+05\n", - "35 2021 Republican Party of Minnesota - Federal Account 3.682714e+05\n", - "36 2021 EFTPS Fed Tax Payment 2.897723e+05\n", - "37 2021 McCool Digital LLC 2.571873e+05\n", - "38 2021 Yes 4 Minneapolis 2.190000e+05\n", - "39 2021 Democratic Attorneys General Assocation Inc 2.136878e+05\n", - "40 2022 Clarify Agency 2.647481e+08\n", - "41 2022 Great American Media 2.582326e+08\n", - "42 2022 Canal Partners Media 1.593249e+08\n", - "43 2022 Berlin Rosen LTD 1.105615e+08\n", - "44 2022 Red Eagle Media 1.082093e+08\n", - "45 2022 Deliver Strategies 1.074506e+08\n", - "46 2022 Nebo Media 8.849665e+07\n", - "47 2022 Sage Media Planning Placement 8.776352e+07\n", - "48 2022 FP1 Digital LLC 8.138634e+07\n", - "49 2022 Schultz, Jennifer House Committee 8.054502e+07\n", - "50 2023 MN DFL State Central Committee 7.828450e+05\n", - "51 2023 GRSG Company 5.000000e+05\n", - "52 2023 The People's Canvass 4.230976e+05\n", - "53 2023 MN DFL Senate Caucus 2.496439e+05\n", - "54 2023 MN DFL House Caucus 2.427772e+05\n", - "55 2023 AGC of MN 1.343460e+05\n", - "56 2023 SMART PAL-Education 1.200000e+05\n", - "57 2023 Teamsters Joint Council 32 8.893821e+04\n", - "58 2023 All of Mpls 8.621453e+04\n", - "59 2023 Apparatus 7.000000e+04" + " Year VendorName Amount\n", + "0 2018 Great American Media 7.092650e+06\n", + "1 2018 Clarify Agency 3.904962e+06\n", + "2 2018 Nebo Media 3.017132e+06\n", + "3 2018 Berlin Rosen LTD 1.425687e+06\n", + "4 2018 Ax Media 1.370301e+06\n", + "5 2018 Sage Media Planning Placement 9.975067e+05\n", + "6 2018 Larry John Wright Advertising Inc 8.335000e+05\n", + "7 2018 Gumbinner Davies 7.910048e+05\n", + "8 2018 Targeted CreativeCommunication 6.808424e+05\n", + "9 2018 E Street Group LLC 6.327749e+05\n", + "10 2019 Canal Partners Media 3.626000e+05\n", + "11 2019 Berlin Rosen LTD 6.373017e+04\n", + "12 2019 Nebo Media 5.850000e+04\n", + "13 2019 Majority Strategies 5.400000e+04\n", + "14 2019 Weber Johnson Public Affairs 4.471800e+04\n", + "15 2019 Front Runner Digital 3.847900e+04\n", + "16 2019 Clarify Agency 3.158908e+04\n", + "17 2019 Singularis 2.251155e+04\n", + "18 2019 AppNexus Inc 1.951000e+04\n", + "19 2019 Connection Strategy LLC 1.796022e+04\n", + "20 2020 Clarify Agency 1.710700e+07\n", + "21 2020 Canal Partners Media 1.013758e+07\n", + "22 2020 Sage Media Planning Placement 9.441231e+06\n", + "23 2020 Gumbinner Davies 8.908617e+06\n", + "24 2020 FP1 Digital LLC 7.931499e+06\n", + "25 2020 Blueprint Interactive 5.614262e+06\n", + "26 2020 Berlin Rosen LTD 4.278030e+06\n", + "27 2020 Wildfire Mail 3.743325e+06\n", + "28 2020 Targeted CreativeCommunication 3.461442e+06\n", + "29 2020 Left Hook 3.343557e+06\n", + "30 2021 New Publica LLC 2.006310e+05\n", + "31 2021 Real Strategies 1.199037e+05\n", + "32 2021 Eye Contact Media 3.000000e+04\n", + "33 2021 (MN) Access Marketing 1.305000e+04\n", + "34 2021 Planned Parenthood MN ND SD Action Fund 9.520600e+03\n", + "35 2021 CliftonLarsonAllen 7.671000e+03\n", + "36 2021 Minnesota Campaign Finance Board 7.500000e+02\n", + "37 2021 Facebook 7.260000e+02\n", + "38 2022 Clarify Agency 2.831990e+08\n", + "39 2022 Great American Media 2.675292e+08\n", + "40 2022 Canal Partners Media 1.777085e+08\n", + "41 2022 Deliver Strategies 1.184445e+08\n", + "42 2022 Berlin Rosen LTD 1.128677e+08\n", + "43 2022 Red Eagle Media 1.118814e+08\n", + "44 2022 Sage Media Planning Placement 9.786503e+07\n", + "45 2022 Nebo Media 9.038561e+07\n", + "46 2022 FP1 Digital LLC 8.575528e+07\n", + "47 2022 Targeted Creative Communication 8.388532e+07\n", + "48 2023 GRSG Company 1.007000e+06\n", + "49 2023 The People's Canvass 7.261599e+05\n", + "50 2023 Eye Contact Media 2.510000e+05\n", + "51 2023 Nordeast Digital 1.600000e+05\n", + "52 2023 Pivot Mailing 1.073689e+05\n", + "53 2023 Printastik 7.429610e+04\n", + "54 2023 Seven Corners Print and Promo 7.181544e+04\n", + "55 2023 Apparatus 6.426000e+04\n", + "56 2023 Do-GoodBiz 5.364402e+04\n", + "57 2023 Postmaster 4.603125e+04" ] }, - "execution_count": 17, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -7143,7 +8968,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -7159,9 +8984,38 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 18, "metadata": {}, "outputs": [ + { + "data": { + "text/html": [ + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + }, { "data": { "application/vnd.plotly.v1+json": { @@ -7169,39 +9023,6 @@ "plotlyServerURL": "https://plot.ly" }, "data": [ - { - "alignmentgroup": "True", - "hovertemplate": "Spender Type=Candidate
Year=%{x}
Amount=%{y}", - "legendgroup": "Candidate", - "marker": { - "color": "#636efa", - "pattern": { - "shape": "" - } - }, - "name": "Candidate", - "offsetgroup": "Candidate", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - 2018, - 2019, - 2020, - 2021, - 2022 - ], - "xaxis": "x", - "y": [ - 26548504.63, - 3229041.3, - 17033964.74, - 4899697.12, - 56693359.6 - ], - "yaxis": "y" - }, { "alignmentgroup": "True", "hovertemplate": "Spender Type=Political Committee and Fund
Year=%{x}
Amount=%{y}", @@ -7228,12 +9049,12 @@ ], "xaxis": "x", "y": [ - 79594084.34, - 14796360.9756, - 58282735.1, - 13892135.67, - 1805191463.08, - 4122720.01 + 24593840.52, + 319162.02, + 35961980.29, + 382252.34, + 1784959169.2, + 2746372.45 ], "yaxis": "y" }, @@ -7257,18 +9078,14 @@ 2018, 2019, 2020, - 2021, - 2022, - 2023 + 2022 ], "xaxis": "x", "y": [ - 31848724.06, - 8098960.0222, - 36032934.727, - 8015610.15, - 937871124.335, - 32803.71 + 8541591.08, + 525336.89, + 72933007.88, + 977022482.31 ], "yaxis": "y" } @@ -8124,9 +9941,9 @@ } }, "text/html": [ - "