I Have a dataframe with 3 columns namely cuid ,type , errorreason. Now the error reason is empty and I have to fill it with the following logic-
1.) If cuid is unique and type is 'COL' then errorreason is 'NO ERROR'( ALL UNIQUE VALUES ARE 'NO ERROR')
2.) If cuid is not unique , and type is 'COL' AND 'ROT' , then error is errorreason is 'AD'
3.) If cuid is not unique , and type is 'COL' AND 'TOT' , then error is errorreason is 'RE'
4.) Any other case , except the above mentioned , errorreason is 'Unidentified'
I have already seperated the unique and non unique values , so first point is done. Kinda stuck on the next points . I was trying to group by the non unique values and then apply a function. Kinda stuck here.