Read the committees from the csv files into a single Dataframe. Intended for importing new data.

def import_committees(src):
    """
    Read the committees from the csv files into a single Dataframe. Intended for importing new data.
    """
    committees = []
    subcommittees = []

    with open("{0}/{1}/committees-current.yaml".format(src, LEGISLATOR_DIR),
              'r') as stream:
        committees += yaml.load(stream)

    with open("{0}/{1}/committees-historical.yaml".format(src, LEGISLATOR_DIR),
              'r') as stream:
        committees += yaml.load(stream)

    # Sub Committees are not Committees
    # And unfortunately the good folk at thomas thought modeling data with duplicate id's was a good idea.
    # you can have two subcommittees with the ID 12. Makes a simple membership map impossible.
    for com in committees:
        com['committee_id'] = com['thomas_id']
        if 'subcommittees' in com:
            # process sub committees into separate DataFrame
            for subcom in com.get('subcommittees'):
                subcom['committee_id'] = com[
                    'thomas_id'
                ]  # we use committee_id so we can easily merge dataframes
                subcom['subcommittee_id'] = "{0}-{1}".format(
                    subcom['committee_id'], subcom['thomas_id'])
                subcommittees.append(subcom)

            del com['subcommittees']

    committees_df = pd.DataFrame(committees)
    subcommittees_df = pd.DataFrame(subcommittees)

    return [committees_df, subcommittees_df]