'Setting the minimum value of a pandas column using clip
I want to set the minimum value of a column of pandas dataframe using clip method. Below is my code
import pandas as pd
data = pd.DataFrame({'date' : pd.to_datetime(['2010-12-31', '2012-12-31', '2012-12-31']), 'val' : [1,2, 5]})
data.clip(lower=pd.Series({'val': 4}), axis=1)
Above code is giving error. Could you please help on how to eliminate the error?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
