I have 2 dataframes:
Reference_DF:
root_cause_level3 root_cause_level2 root_cause_level1
NA NA NA
Natural Disaster Natural Disaster Natural Disaster
Other Other Other
Communications Misunderstood Long Message
Actual_DF:
incident_id root_cause_level3 root_cause_level2 root_cause_level1
XXXXXXXX-1 Communications
XXXXXXXX-2 NA
XXXXXXXX-3 NA
XXXXXXXX-4 Other
XXXXXXXX-1 Natural Disaster
My goal is to map from Reference DF to Actual DF the level2 and level1 root causes. I want to map it based on matching level3 root causes. I don't know how to do that, any suggestions on how to solve this problem?
Expected output:
incident_id root_cause_level3 root_cause_level2 root_cause_level1
XXXXXXXX-1 Communications Misunderstood Long Message
XXXXXXXX-2 NA NA NA
XXXXXXXX-3 NA NA NA
XXXXXXXX-4 Other Other Other
XXXXXXXX-1 Natural Disaster Natural Disaster Natural Disaster