I am trying to fill df with values form a different one.
The first df is:
The second df is:
I want to add the column to first df having values from the second one to receive output:
I came up with code:
found =  for index, row in one.iterrows(): for ind, rw in two.iterrows(): if ind not in found: if (one.loc[index, 'number'] == two.loc[ind, 'number']) & \ (one.loc[index, 'trans'] == two.loc[ind, 'trans']) & \ one.loc[index,'value'] = two.loc[ind, one.loc[index, 'date']] found.append(int(ind)) break
It works but it is extremely slow. How it should be done properly?