If I have a pandas dataframe that looks like this:
X [ m ] Y [ m ] Z [ m ]
0 1 1 0.0
1 2 0.5 0.1
2 3 2 0.3
3 4 1 0.4
4 5 3 0.5
5 1 4 0.6
6 2 1.5 0.8
7 3 6 1.0
8 4 3 1.2
9 5 4 1.5
...
How would I add a fourth column (Z_2) that would look like this (only include values that are a 0.5 jump):
X [ m ] Y [ m ] Z [ m ] Z_2 [ m ]
0 1 1 0.0 0.0
1 2 0.5 0.1 0.0
2 3 2 0.3 0.5
3 4 1 0.4 0.5
4 5 3 0.5 0.5
5 1 4 0.6 0.5
6 2 1.5 0.8 1.0
7 3 6 1.0 1.0
8 4 3 1.2 1.0
9 5 4 1.5 1.5
...
Zalways increasing? Can it contain negative numbers? If so do you want-1.3to go to-1.0(round towards zero) or-1.5(round down)?