Finances of Members of Congress

/ Research Projects About

I found some data[1] on the net worths of members of Congress (in 2018) at the website of the Center for Responsive Politics. Unfortunately, this data is in a big HTML table and I could not find a spreadsheet or anything. I wrote some code in Python to scrape the webpage and do a little bit of analysis:

import pandas as pd
import requests


["Average"] = df["Average"].replace('[\$,]', '', regex=True).astype(float)


print("Median for Democrat members of Congress:   $"+str(dem["Average"].median()))
print("Median for Republican members of Congress: $"+str(rep["Average"].median()))
  Median for Democrat members of Congress:   $1165006.5
Median for Republican members of Congress: $1191022.0

Python file:

IPython notebook networth.ipynb

[1]“Net Worth - 2018.” OpenSecrets, The Center for Responsive Politics, Accessed 12 Mar. 2021.