def import_committees(src):
committees = []<EOL>subcommittees = []<EOL>with open("<STR_LIT>".format(src, LEGISLATOR_DIR),<EOL>'<STR_LIT:r>') as stream:<EOL><INDENT>committees += yaml.load(stream)<EOL><DEDENT>with open("<STR_LIT>".format(src, LEGISLATOR_DIR),<EOL>'<STR_LIT:r>') as stream:<EOL><INDENT>committees += yaml.load(stream)<EOL><DEDENT>for com in committees:<EOL><INDENT>com['<STR_LIT>'] = com['<STR_LIT>']<EOL>if '<STR_LIT>' in com:<EOL><INDENT>for subcom in com.get('<STR_LIT>'):<EOL><INDENT>subcom['<STR_LIT>'] = com[<EOL>'<STR_LIT>'<EOL>]  <EOL>subcom['<STR_LIT>'] = "<STR_LIT>".format(<EOL>subcom['<STR_LIT>'], subcom['<STR_LIT>'])<EOL>subcommittees.append(subcom)<EOL><DEDENT>del com['<STR_LIT>']<EOL><DEDENT><DEDENT>committees_df = pd.DataFrame(committees)<EOL>subcommittees_df = pd.DataFrame(subcommittees)<EOL>return [committees_df, subcommittees_df]<EOL>
Read the committees from the csv files into a single Dataframe. Intended for importing new data.