My input dataframe;
A B C
0 0 1 1.3
1 1.2 2 2.25
2 1.5 3 4.42
3 2.7 4 5.12
4 3.9 5 6.24
5 4.55 6 7.25
I want to round the C columns according to a threshold in dataframe. But i couldn' t get the desired results.
Code is;
threshold=0.25
df['C']=round(df['C'] - threshold+0.5)
Output is;
A B C
0 0 1 2
1 1.2 2 2
2 1.5 3 5
3 2.7 4 5
4 3.9 5 6
5 4.55 6 7
Desired output is;
A B C
0 0 1 2
1 1.2 2 3
2 1.5 3 5
3 2.7 4 5
4 3.9 5 6
5 4.55 6 8
I got a trouble with .25 value. I want to round up this values too. Could ypu please help me about this?