I have a dataframe with different sections (only 2 sections and speeds here, but a circuit can be up to 8 sections and 6 measured speeds) like so:
| section | speed | Data1 | Data2 |
|---|---|---|---|
| A | 10 | 1.5 | 2.5 |
| A | 20 | 1.0 | 2.0 |
| B | 10 | 2.5 | 3.5 |
| B | 20 | 2.0 | 3.0 |
I would like to sum my data columns over all possible circuits
| A | B | Data1 | Data2 |
|---|---|---|---|
| 10 | 10 | 4.0 | 6.0 |
| 10 | 20 | 3.5 | 5.5 |
| 20 | 10 | 3.5 | 5.5 |
| 20 | 20 | 3.0 | 5.0 |
How would I do this? I can make the combinations, but not sure how to sum the data columns over them.
2**2is simple,8**6is not trivial :P