dfmax = df.groupby('idn')['value'].max()
df.set_index('idn', inplace=True)
df = df.merge(dfmax, how='outer', left_index=True, right_index=True)
df.reset_index(inplace=True)
Merging a pandas groupby result back into DataFrame