add average value to every row containing value in different column
The comments above are helpful, I have found this to be the easiest method, where average is the df with average wages. (ffr)
df_main['avgWage'] = df['age'].map(average_df['averageWage'])
I have a dataset with ages (int) and wages, I would like to have the average wage next to each row of a person respective of that age.
I created a smaller dataset using
mean = df.groupby('age', as_index=False)['lnWage'].mean()
what is the best way to append (for 2000 rows)?




Age
Wage




30
10


30
20




then




Age
Wage
averagewage




30
10
15


30
20
15




thanks!