I have two data frames, the first has the following structure:
month| u_id | other columns
1 1
1 2
2 1
2 2
3 1
3 2
The 2nd data frame has only 2 rows which are the name associated with u_id = 1 and u_id = 2:
id name
0 u1
1 u2
I would like to add a new column in the 1st dataframe to contain the names so the result would be:
month| u_id | u_name
1 1 u1
1 2 u2
2 1 u1
2 2 u2
3 1 u1
3 2 u2
I tried pandas concat
function but I did not get the result I want, is there any function to achieve this ?