@staticmethod
def combine_results_and_polls(results, polls):
    """Merge national polling, and geo-level polling if available, into results dataframe."""
    results = results.merge(right=polls.query('geo == "uk"')[['party',
        'voteshare']].rename(columns={'voteshare': 'national_polls'}), on=
        'party', how='outer').sort_values(['ons_id', 'party']).reset_index(drop
        =True)
    if set(polls.geo.unique()) != {'uk'}:
        results = results.merge(right=polls.query('geo != "uk"')[['geo',
            'party', 'voteshare']].rename(columns={'voteshare': 'geo_polls'
            }), on=['geo', 'party'], how='outer').sort_values(['ons_id',
            'party']).reset_index(drop=True)
    return results
