Reg No. | Session | Course No. = Name Credit = Semester = | CSE133 3.00 1st Semester | CSE134 2.00 1st Semester | CSE143 3.00 1st Semester | CSE144 1.00 1st Semester
407 | 2017331108 | 2017-2018 | ZESHAN AHMED NABIN | 0.00 F | 4.00 A+ | 4.00 A+ | 3.00 B
408 | 2017331108 | 2017-2018 | ZESHAN AHMED NABIN | NaN | NaN | NaN | NaN
409 | 2017331108 | 2017-2018 | ZESHAN AHMED NABIN | 2.25 C | NaN | | NaN
410 | 2017331108 | 2017-2018 | ZESHAN AHMED NABIN | NaN | NaN | NaN | NaN
411 | 2017331109 | 2017-2018 | MD. ZAHIDUL AKRAM RATUL | 3.75 A | 3.75 A | 2.50 C+ | 3.75 A
412 | 2017331109 | 2017-2018 | MD. ZAHIDUL AKRAM RATUL | NaN | NaN | NaN | NaN
413 | 2017331109 | 2017-2018 | MD. ZAHIDUL AKRAM RATUL | | NaN | | NaN
414 | 2017331109 | 2017-2018 | MD. ZAHIDUL AKRAM RATUL | NaN | NaN | NaN | NaN
I want to merge this dataframe so that the 4 rows gets merged with the highest value from each of the columns and there are 400 more similar inputs like this where each four of them has the same session, name.
The output I want:
Reg No. | Session | Course No. = Name Credit = Semester = | CSE133 3.00 1st Semester | CSE134 2.00 1st Semester | CSE143 3.00 1st Semester | CSE144 1.00 1st Semester
407 | 2017331108 | 2017-2018 | ZESHAN AHMED NABIN | 2.25 C | 4.00 A+ | 4.00 A+ | 3.00 B
411 | 2017331109 | 2017-2018 | MD. ZAHIDUL AKRAM RATUL | 3.75 A | 3.75 A | 2.50 C+ | 3.75 A
The blank space in row 409 indicates empty string(""). I don't know what code to write to get my desired output.