I have the following data frame:
ID_number Name Date S_code S_description
1 Dani 01/2017 G1 PROCEDURE ON SINGLE VESSEL
1 Dani 01/2017 R56 INSERTION OF THREE VASCULAR STENTS
1 Dani 06/2017 L34 CHOLECYSTECTOMY
2 Alice 03/2015 L12 OTHER CYSTOSCOPY
3 Elle 04/2015 L34 CHOLECYSTECTOMY
3 Elle 04/2015 H6 EXCISION OR DESTRUCTION OF PERITONEAL TISSUE
I want to combine rows if the columns "ID_Number", "Name" and "Date" are identical, and the columns "S_code" and "S_description" will be concatenated so that the Data will look like this:
ID_number Name Date S_code S_description
1 Dani 01/2017 G1,R56 PROCEDURE ON SINGLE VESSEL,INSERTION OF THREE VASCULAR STENTS
1 Dani 06/2017 L34 CHOLECYSTECTOMY
2 Alice 03/2015 L12 OTHER CYSTOSCOPY
3 Elle 04/2015 L34,H6 CHOLECYSTECTOMY,EXCISION OR DESTRUCTION OF PERITONEAL TISSUE
The "ID_Number" column is sorted.
I'm new with Python and I will appreciate any help with this issue!