I have a dataframe that has some rows that have missing data, but there are rows that are completed and are the same as those that have missing data. I would like my dataframe to have only the complete ID but not exclude those that do not have any information. For example among these identical IDs which ones contain more information taking into account the TYPE.
The input is:
ID TYPE HEIGHT KG
-----------------------------
MEXU DOL NaN 40
RFGT DOL 140 47
RFGT DOL NaN NaN
RFGT RET 90 NaN
OJKU NaN NaN NaN
TYED NaN NaN 80
TYED NaN 100 80
TYED DOL 100 80
PJLO RET NaN NaN
PJLO DOL NaN NaN
BUAR NaN NaN NaN
Do I have to use some sort of groupby or agg in pandas?
Expected output:
ID TYPE HEIGHT KG
-----------------------------
MEXU DOL NaN 40
RFGT DOL 140 47
RFGT RET 90 NaN
OJKU NaN NaN NaN
TYED DOL 100 80
PJLO RET NaN NaN
PJLO DOL NaN NaN
BUAR NaN NaN NaN