df = pd.read_csv(filename, index_col=0)

def region_to_numeric(a):
    if a == 'Geo RS/SC':
        return 1
if a == 'Geo PR/SPI':
    return 2
How to replace string values in pandas dataframe to integers?