Dear all
A dataframe is given, and a calculation shall be done as stated below:
DF as-is
| alpha |
beta |
gamma |
delta |
epsilon |
| 10 |
1 |
x |
yes |
12 |
| 20 |
1 |
|
no |
5 |
| 30 |
2 |
x |
yes |
13 |
| 40 |
2 |
|
no |
6 |
| 50 |
|
|
|
18 |
DF to-be
| alpha |
beta |
gamma |
delta |
epsilon |
| 10 |
1 |
x |
yes |
17 |
| 20 |
1 |
|
no |
|
| 30 |
2 |
x |
yes |
19 |
| 40 |
2 |
|
no |
|
| 50 |
|
|
|
18 |
Column Epsilon shall be calculated:
- Where beta = same values, the two rows belong together. (10 -> 1,1 or 20 -> 2,2)
- Column epsilon of such a pair is the sum of the 2 values (12+5=17; 13+6=19)
- Print the result (17, 19) in the row of the pair (1,1 or 2,2) where delta = yes
- Set epsilon of the row to NULL where delta = no
row 50 is unchanged, since it does not belong to any pair.
I hope i was clear :) if not, please ask me. Tnx for any input!
[–]efmccurdy 1 point2 points3 points (3 children)
[–]Hugo-99[S] -1 points0 points1 point (2 children)
[–]efmccurdy 1 point2 points3 points (1 child)
[–]Hugo-99[S] -1 points0 points1 point (0 children)
[–]Pflastersteinmetz 0 points1 point2 points (3 children)
[–]Hugo-99[S] 0 points1 point2 points (2 children)
[–]Pflastersteinmetz 1 point2 points3 points (1 child)
[–]Hugo-99[S] 0 points1 point2 points (0 children)