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']
In [211]:
committees[18]
Out[211]:
In [212]:
members = yaml.load(open('../../congress-legislators/committee-membership-current.yaml'))
In [213]:
members['HSSY20']
Out[213]:
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 [ ]: