df
df.replace(1, 100)
df.replace([1, 2], 999)
Replace values using regular expression.
df = df.astype('str') df.replace(r'^([0-9])$', r'new_\1', regex=True)