0

Apologies if this question has been asked previously. I am looking for a way to perform a conditional vlookup from one dataframe (df2) to a main one (df1). Please see example below. I only need to look up the NaN values in df1 and not the entire dataframe. I believe merging is one way to do it but I was wondering if there is better way to achieve this. Something like

If df1 [mobile no] = NaN, vlookup it from df2 based on df1[name] key

df1

name           mobile_no      
0   Hector ABC       123       
1   Hector ABC       287        
2   Jose JKD         567      
3   Luis AH          NaN      
4   Billy DH         NaN 
5   Harry AC         569

df2

    name           mobile_no      
  
3   Luis AH          777      
4   Billy DH         999 
sammywemmy
  • 22,944
  • 4
  • 14
  • 28
rb_27
  • 1

0 Answers0