this is the first data frame
Umls Snomed
C0027497/Nausea /Sign or Symptom Nausea (finding)[FN/422587007]
C0151786 / Muscle/Sign or Symptom Muscle weakness [(finding) /FN/26544005]
C2127305 /bitter/ Sign or Symptom ?
NA NA
I created a dictionary of it using the following code
df_dic_1= df_dic_1[['UMLS', 'snomed']]
df_dic_1['UMLS'].fillna(0, inplace=True)
df_dic_1['snomed'].fillna(0, inplace=True)
equiv_snomed=df_dic_1.set_index('UMLS')['snomed'].to_dict()
Now, for data frame B:
id symptom UMLS
1 nausea C0027497/Nausea /Sign or Symptom
2 muscle C2127305 /bitter/ Sign or Symptom
3 headache
4 pain
5 bitter C2127305 /bitter/ Sign or Symptom
For any value in "UMLS" column that is available in the dictionary, I want to create another column "Snomed" that includes "snomed" values from the dictionary. So data frame C should be like this:
id symptom UMLS Snomed
1 nausea C0027497/Nausea /Sign or Symptom Nausea (finding)[FN/422]
2 muscle C0151786 / Muscle/Sign or Symptom Muscle [(fi)/FN/25]
3 headache
4 pain
5 bitter C2127305 /bitter/ Sign or Symptom ?
Any help? thanks