df1 = pd.DataFrame({'user': ['Bob','Bob','Bob'],'income':[400,500, 420],'expenses':[400,2500,420]})
df1.user.unique()
return_val = df[(df['Payer']=='Bob')]
I have two dataframes (df and df1) and I do not want to hard code 'Bob' in return_val. Is there anyway through which I can get 'Bob' by reading df1 ? Am trying something like this which seems incomplete.
return_val = df[(df['Payer']== df1.user.unique())]