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)
More Related Contents:
- Find the column name which has the maximum value for each row
- Find maximum value of a column and return the corresponding row values using Pandas
- return max value from pandas dataframe as a whole, not based on column or rows
- Get max value from row of a dataframe in python [duplicate]
- Filter pandas DataFrame by substring criteria
- Aggregation in Pandas
- Compare two DataFrames and output their differences side-by-side
- Selecting a row of pandas series/dataframe by integer index
- How do I find the closest values in a Pandas series to an input number?
- How do I count the NaN values in a column in pandas DataFrame?
- getting the index of a row in a pandas apply function
- How to flatten a pandas dataframe with some columns as json?
- Tilde sign in pandas DataFrame
- Drop columns whose name contains a specific string from pandas DataFrame
- Python Pandas How to assign groupby operation results back to columns in parent dataframe?
- Pandas won’t fillna() inplace
- Convert Pandas Series to DateTime in a DataFrame
- Loading multiple csv files of a folder into one dataframe
- Why is np.where faster than pd.apply
- Extract column value based on another column in Pandas
- Python Pandas: Get index of rows where column matches certain value
- Change the color of text within a pandas dataframe html table python using styles and css
- Dynamically filtering a pandas dataframe
- Remove substring from column based on another column
- Got continuous is not supported error in RandomForestRegressor
- How to convert string representation of dictionary in Pandas DataFrame to a new columns?
- Get the row corresponding to the max in pandas GroupBy [duplicate]
- Copy text between parentheses in pandas DataFrame column into another column
- Get frequency of item occurrences in a column as percentage [duplicate]
- Pandas explode multiple columns [duplicate]