dataframe.clip_lower() is used to trim values at a given input threshold. We use this function to trim all values below the input threshold.
Syntax: DataFrame.clip_lower (threshold, axis = None, inplace = False)
threshold: numeric or array-like
float: every value is compared to threshold .
array-like: The shape of threshold should match the object it’s compared to. When self is a Series, threshold should be the length. When self is a DataFrame, threshold should 2-D and the same shape as self for axis = None, or 1-D and the same length as the axis being compared.
axis: Align self with threshold along the given axis.
inplace: Whether to perform the operation in place on the data.
Returns: clipped: same type as input
Example # 1: Use
clip_lower () to trim dataframe values below a given threshold.
Example # 2: Use
clip_lower () to
clip_lower () values in the data frame with a specific value for each cell of the data frame.
For this purpose we can use an empty array, but the shape of the array must be the same as that of the information frame.
Now apply these restrictions to the data frame.
Each cell value has been truncated based on the corresponding lower limit.