I have the following problem. I have a dataframe that contains an important value for another dataframe and it is necessary to take it directly from there, here is an example:
import pandas as pd
df = pd.DataFrame({'user': ['A', 'B', 'C'],
'income': [1, 5, 4]})
df_v2 = pd.DataFrame({'user': ['A', 'B', 'C'],
'name': ['John', 'Peter', 'Anne']})
I must check if the user is the same between the two dataframes, if so, in the df_2 I must add the income column, the result would be the following:
df_v2 = pd.DataFrame({'user': ['A', 'B', 'C'],
'name': ['John', 'Peter', 'Anne']
'income': [1, 5, 4]})
Any suggestions?