I have a dataframe that is way bigger than it needs to be. Due to necessary transformations beforehand, I receive a dataframe looking like this:
A | B | C | D | E | F |
---|---|---|---|---|---|
1.5 | 3 | 2 | a | 0 | 0 |
1.5 | 3 | 2 | 0 | b | 0 |
1.5 | 3 | 2 | 0 | 0 | c |
This is what it should look like afterwards:
A | B | C | D | E | F |
---|---|---|---|---|---|
1.5 | 3 | 2 | a | b | c |
-----------------------------------------------------------------------------------
The second problem is that values are vertically listed, even though they could be next to each other. Example:
A1 | A2 | C |
---|---|---|
1.5 | NA | 2 |
1.5 | NA | 2 |
2.5 | NA | 2 |
Instead, I want this:
A1 | A2 | C |
---|---|---|
1.5 | 2.5 | 2 |