You can use clip.
Apply to all columns of the data frame:
df.clip(upper=15)
Otherwise apply to selected columns as seen here:
df.clip(upper=pd.Series({'a': 15}), axis=1)
You can use clip.
Apply to all columns of the data frame:
df.clip(upper=15)
Otherwise apply to selected columns as seen here:
df.clip(upper=pd.Series({'a': 15}), axis=1)