In [208]:
import yaml
import pandas as pd

In [209]:
committees = yaml.load(open('../../congress-legislators/committees-current.yaml'))

In [210]:
for i, comm in enumerate(committees):
    print i, comm['thomas_id'], comm['name']


0 HSAG House Committee on Agriculture
1 HSAP House Committee on Appropriations
2 HSAS House Committee on Armed Services
3 HSBA House Committee on Financial Services
4 HSBU House Committee on the Budget
5 HSED House Committee on Education and the Workforce
6 HSFA House Committee on Foreign Affairs
7 HSGO House Committee on Oversight and Government Reform
8 HSHA House Committee on House Administration
9 HSHM House Committee on Homeland Security
10 HSIF House Committee on Energy and Commerce
11 HSII House Committee on Natural Resources
12 HLIG House Permanent Select Committee on Intelligence
13 HSJU House Committee on the Judiciary
14 HSPW House Committee on Transportation and Infrastructure
15 HSRU House Committee on Rules
16 HSSM House Committee on Small Business
17 HSSO House Committee on Ethics
18 HSSY House Committee on Science, Space, and Technology
19 HLZI House Select Committee on the Events Surrounding the 2012 Terrorist Attack in Benghazi
20 HSVR House Committee on Veterans' Affairs
21 HSWM House Committee on Ways and Means
22 JCSE Commission on Security and Cooperation in Europe
23 JSEC Joint Economic Committee
24 JSLC Joint Committee on the Library
25 JSPR Joint Committee on Printing
26 JSTX Joint Committee on Taxation
27 SCNC United States Senate Caucus on International Narcotics Control
28 SLET Senate Select Committee on Ethics
29 SLIA Senate Committee on Indian Affairs
30 SLIN Senate Select Committee on Intelligence
31 SPAG Senate Special Committee on Aging
32 SSAF Senate Committee on Agriculture, Nutrition, and Forestry
33 SSAP Senate Committee on Appropriations
34 SSAS Senate Committee on Armed Services
35 SSBK Senate Committee on Banking, Housing, and Urban Affairs
36 SSBU Senate Committee on the Budget
37 SSCM Senate Committee on Commerce, Science, and Transportation
38 SSEG Senate Committee on Energy and Natural Resources
39 SSEV Senate Committee on Environment and Public Works
40 SSFI Senate Committee on Finance
41 SSFR Senate Committee on Foreign Relations
42 SSGA Senate Committee on Homeland Security and Governmental Affairs
43 SSHR Senate Committee on Health, Education, Labor, and Pensions
44 SSJU Senate Committee on the Judiciary
45 SSRA Senate Committee on Rules and Administration
46 SSSB Senate Committee on Small Business and Entrepreneurship
47 SSVA Senate Committee on Veterans' Affairs

In [211]:
committees[18]


Out[211]:
{'address': '2321 RHOB; Washington, DC 20515-6301',
 'house_committee_id': 'SY',
 'jurisdiction': 'The Committee on Science, Space, and Technology has jurisdiction over energy research, all federally owned or operated non-military energy laboratories, astronautical research and development, civil aviation, environmental research and development, marine research, the National Institute of Standards and Technology, NASA, NSF, NWS, outer space, and other aspects of scientific research.',
 'jurisdiction_source': 'http://science.house.gov/jurisdiction',
 'minority_rss_url': 'http://democrats.science.house.gov/rss.xml',
 'minority_url': 'http://democrats.science.house.gov/',
 'name': 'House Committee on Science, Space, and Technology',
 'phone': '(202) 225-6371',
 'rss_url': 'http://science.house.gov/rss.xml',
 'subcommittees': [{'address': '2319 RHOB; Washington, DC 20515',
   'name': 'Energy',
   'phone': '(202) 225-6371',
   'thomas_id': '20'},
  {'address': '2321 RHOB; Washington, DC 20515',
   'name': 'Oversight',
   'phone': '(202) 225-6371',
   'thomas_id': '21'},
  {'address': '4220 OFOB; Washington, DC 20515',
   'name': 'Space',
   'phone': '(202) 225-6371',
   'thomas_id': '16'},
  {'address': '2319 RHOB; Washington, DC 20515',
   'name': 'Environment',
   'phone': '(202) 225-6371',
   'thomas_id': '18'},
  {'address': '4220 OFOB; Washington, DC 20515',
   'name': 'Research and Technology',
   'phone': '(202) 225-6371',
   'thomas_id': '15'}],
 'thomas_id': 'HSSY',
 'type': 'house',
 'url': 'http://science.house.gov/'}

In [212]:
members = yaml.load(open('../../congress-legislators/committee-membership-current.yaml'))

In [213]:
members['HSSY20']


Out[213]:
[{'bioguide': 'W000814',
  'name': 'Randy K. Weber, Sr.',
  'party': 'majority',
  'rank': 1,
  'thomas': '02161',
  'title': 'Chair'},
 {'bioguide': 'R000409',
  'name': 'Dana Rohrabacher',
  'party': 'majority',
  'rank': 2,
  'thomas': '00979'},
 {'bioguide': 'L000491',
  'name': 'Frank D. Lucas',
  'party': 'majority',
  'rank': 3,
  'thomas': '00711'},
 {'bioguide': 'B001274',
  'name': 'Mo Brooks',
  'party': 'majority',
  'rank': 4,
  'thomas': '01987'},
 {'bioguide': 'H001059',
  'name': 'Randy Hultgren',
  'party': 'majority',
  'rank': 5,
  'thomas': '02015'},
 {'bioguide': 'M001184',
  'name': 'Thomas Massie',
  'party': 'majority',
  'rank': 6,
  'thomas': '02094'},
 {'bioguide': 'B001283',
  'name': 'Jim Bridenstine',
  'party': 'majority',
  'rank': 7,
  'thomas': '02155'},
 {'bioguide': 'K000387',
  'name': 'Stephen Knight',
  'party': 'majority',
  'rank': 8,
  'thomas': '02228',
  'title': 'Vice Chair'},
 {'bioguide': 'L000585',
  'name': 'Darin LaHood',
  'party': 'majority',
  'rank': 9,
  'thomas': '02295'},
 {'bioguide': 'W000806',
  'name': 'Daniel Webster',
  'party': 'majority',
  'rank': 10,
  'thomas': '02002'},
 {'bioguide': 'D000628',
  'name': 'Neal P. Dunn',
  'party': 'majority',
  'rank': 11},
 {'bioguide': 'S000583',
  'name': 'Lamar Smith',
  'party': 'majority',
  'rank': 12,
  'thomas': '01075',
  'title': 'Ex Officio'},
 {'bioguide': 'V000131',
  'name': 'Marc A. Veasey',
  'party': 'minority',
  'rank': 1,
  'thomas': '02166',
  'title': 'Ranking Member'},
 {'bioguide': 'L000397',
  'name': 'Zoe Lofgren',
  'party': 'minority',
  'rank': 2,
  'thomas': '00701'},
 {'bioguide': 'L000563',
  'name': 'Daniel Lipinski',
  'party': 'minority',
  'rank': 3,
  'thomas': '01781'},
 {'bioguide': 'R000608',
  'name': 'Jacky Rosen',
  'party': 'minority',
  'rank': 4},
 {'bioguide': 'M001166',
  'name': 'Jerry McNerney',
  'party': 'minority',
  'rank': 5,
  'thomas': '01832'},
 {'bioguide': 'T000469',
  'name': 'Paul Tonko',
  'party': 'minority',
  'rank': 6,
  'thomas': '01942'},
 {'bioguide': 'F000454',
  'name': 'Bill Foster',
  'party': 'minority',
  'rank': 7,
  'thomas': '01888'},
 {'bioguide': 'T000472',
  'name': 'Mark Takano',
  'party': 'minority',
  'rank': 8,
  'thomas': '02110'},
 {'bioguide': 'J000126',
  'name': 'Eddie Bernice Johnson',
  'party': 'minority',
  'rank': 9,
  'thomas': '00599',
  'title': 'Ex Officio'}]

In [214]:
df = pd.DataFrame()
# for some reason this dataset doesn't have the memberships for House approps subcommittees...
comm_names = {'SSAP16' : 'Senate Appropriations Subcommittee on Commerce, Justice, Science, and Related Agencies',
              'SSAP22' : 'Senate Appropriations Subcommittee on Energy and Water Development',
              'HSAP'   : 'House Committee on Appropriations',
              'HSED13' : 'House Subcommittee on Higher Education and Workforce Development',
              'HSED14' : 'House Subcommittee on Early Childhood, Elementary, and Secondary Education',
              'SSAP'   : 'Senate Committee on Appropriations',
              'HSIF'   : 'House Committee on Energy and Commerce',
              'HSSY'   : 'House Committee on Science, Space, and Technology',
              'SSCM'   : 'Senate Committee on Commerce, Science, and Transportation',
              'SSEG'   : 'Senate Committee on Energy and Natural Resources',
              'SSEG01' : 'Senate Energy Subcommittee on Energy',
              'SSCM24' : 'Senate Commerce Subcommittee on Science and Space',
              'HSSY15' : 'House Committee on Science, Space, and Technology; Subcommittee on Research and Technology',
              'HSSY20' : 'House Committee on Science, Space, and Technology; Subcommittee on Energy'}

for comm in comm_names.keys():
    for mem in members[comm]:
        if mem['party'] == 'majority':
            party = 'Republican'
        else:
            party = 'Democrat'
        ser = pd.Series([mem['name'],str(mem['rank']),party,comm_names[comm],mem['bioguide']])
        df = df.append(ser,ignore_index=True)

In [215]:
df = df.append(pd.Series(['Mike Simpson', '1', 'Republican', 'House Appropriations Subcommittee on Energy and Water Development','S001148']),ignore_index=True)
df = df.append(pd.Series(['Ken Calvert', '2', 'Republican', 'House Appropriations Subcommittee on Energy and Water Development', 'C000059']),ignore_index=True)
df = df.append(pd.Series(['Chuck Fleischmann', '3', 'Republican', 'House Appropriations Subcommittee on Energy and Water Development', 'F000459']),ignore_index=True)
df = df.append(pd.Series(['Jeff Fortenberry', '4', 'Republican', 'House Appropriations Subcommittee on Energy and Water Development', 'F000449']),ignore_index=True)
df = df.append(pd.Series(['Kay Granger', '5', 'Republican', 'House Appropriations Subcommittee on Energy and Water Development', 'G000377']),ignore_index=True)
df = df.append(pd.Series(['Jaime Herrera Beutler', '6', 'Republican', 'House Appropriations Subcommittee on Energy and Water Development', 'H001056']),ignore_index=True)
df = df.append(pd.Series(['David Joyce', '7', 'Republican', 'House Appropriations Subcommittee on Energy and Water Development', 'J000295']),ignore_index=True)
df = df.append(pd.Series(['Dan Newhouse', '8', 'Republican', 'House Appropriations Subcommittee on Energy and Water Development', 'N000189']),ignore_index=True)
df = df.append(pd.Series(['Marcy Kaptur', '1', 'Democrat', 'House Appropriations Subcommittee on Energy and Water Development', 'K000009']),ignore_index=True)
df = df.append(pd.Series(['Pete Visclosky', '2', 'Democrat', 'House Appropriations Subcommittee on Energy and Water Development', 'V000108']),ignore_index=True)
df = df.append(pd.Series(['Debbie Wasserman Schultz', '3', 'Democrat', 'House Appropriations Subcommittee on Energy and Water Development', 'W000797']),ignore_index=True)
df = df.append(pd.Series(['Pete Aguilar', '4', 'Democrat', 'House Appropriations Subcommittee on Energy and Water Development', 'A000371']),ignore_index=True)
df = df.append(pd.Series(['José Serrano', '5', 'Democrat', 'House Appropriations Subcommittee on Energy and Water Development', 'S000248']),ignore_index=True)
df = df.append(pd.Series(['John Culberson', '1', 'Republican', 'House Appropriations Subcommittee on Commerce, Justice, and Science', 'C001048']),ignore_index=True)
df = df.append(pd.Series(['Hal Rogers',  '2', 'Republican', 'House Appropriations Subcommittee on Commerce, Justice, and Science', 'R000395']),ignore_index=True)
df = df.append(pd.Series(['Robert Aderholt',  '3', 'Republican', 'House Appropriations Subcommittee on Commerce, Justice, and Science', 'A000055']),ignore_index=True)
df = df.append(pd.Series(['John Carter',  '4', 'Republican', 'House Appropriations Subcommittee on Commerce, Justice, and Science', 'C001051']),ignore_index=True)
df = df.append(pd.Series(['Martha Roby',  '5', 'Republican', 'House Appropriations Subcommittee on Commerce, Justice, and Science', 'R000591']),ignore_index=True)
df = df.append(pd.Series(['Steven Palazzo',  '6', 'Republican', 'House Appropriations Subcommittee on Commerce, Justice, and Science', 'P000601']),ignore_index=True)
df = df.append(pd.Series(['Evan Jenkins',  '7', 'Republican', 'House Appropriations Subcommittee on Commerce, Justice, and Science', 'J000297']),ignore_index=True)
df = df.append(pd.Series(['José Serrano',  '1', 'Democrat', 'House Appropriations Subcommittee on Commerce, Justice, and Science', 'S000248']),ignore_index=True)
df = df.append(pd.Series(['Derek Kilmer',  '2', 'Democrat', 'House Appropriations Subcommittee on Commerce, Justice, and Science', 'K000381']),ignore_index=True)
df = df.append(pd.Series(['Matt Cartwright', '3', 'Democrat', 'House Appropriations Subcommittee on Commerce, Justice, and Science', 'C001090']),ignore_index=True)
df = df.append(pd.Series(['Grace Meng', '4', 'Democrat', 'House Appropriations Subcommittee on Commerce, Justice, and Science', 'M001188']),ignore_index=True)

In [216]:
df.to_pickle('../cleaned_data/committee_memberships')

In [ ]: