My data frame looks like this.
a d e
0 BTC 31913.1123 -6.5%
1 ETH 1884.1621 -18.8%
2 USDT 1.0 0.1%
3 BNB 294.0246 -8.4%
4 ADA 1.0342 -14.3%
5 XRP 1.1423 -10.5%
On column d, I want to round the floats in column d to a whole number if it is greater than 10. If it is less than 10, I want to round it to 2 decimal places. This is the code I have right now df1['d'] = df1['d'].round(2)
. How do I had a conditional statement to this code to have it round based on conditions?