I have a data frame df that has the following information:
| Project | class | x |y | z |
| --- | --- | --- | --- | --- |
| Project_A | c.java |a1 | a2 | |
| Project_A | c.java | | | a3 |
| Project_b | t.java |b1 |b2 | |
I need to combine these lines if the values of project and Class are equal among them.
Based on the previous example, the aspected output in this case have be:
| Project | class | x |y | z |
| --- | --- | --- | --- | --- |
| Project_A | c.java |a1 |a2 | a3 |
| Project_b | t.java |b1 |b2 | |
it is also important to note that the way the dataset was constructed, there is no risk of rewriting values; so, in other words, you will never have such a situation:
| Project | class | x |y | z |
| --- | --- | --- | ---| --- |
| Project_A | c.java |a1 | a2 | |
| Project_A | c.java |a_x | a_y|a_z |
| Project_b | t.java |b1 |b2 | |
How can do it?