I have Id column , name and age I want to get the ID value from ID column of the NA value in Name column , how can I do that with python ? I was thinking of using a for loop to get the index of NA then find index of ID but I thought maybe there is an easier way
A = [["1091",'tom', 25], ["192",'krish', 30],
["138",'nick', 26], ["120","",20],["32",'juli', 22],["99","",19]]
B = [["1091","ALEX"], ["192","SAM"],
["138",'JACK'], ["120","MAT"],["99","LISA"]]
dfA = pd.DataFrame(A, columns =['ID','Name', 'Age'])
dfB = pd.DataFrame(B, columns =['ID','Name'])
dfA = dfA.replace("",np.nan, regex=True)
print(dfA)
output dfA
ID Name Age
0 1091 tom 25
1 192 krish 30
2 138 nick 26
3 120 NaN 20
4 32 juli 22
5 99 NaN 19