Update a pandas data frame column using Apply,Lambda and Group by Functions
I used 'Apply' function to every row in the pandas data frame and created a custom function to return the value for the 'Candidate Won' Column using data frame,row-level 'Constituency','% of Votes'

Custom Function Code:

def update_candidateresult(df,a,b):
max_voteshare=df.groupby(df['Constituency']==a)['% of Votes'].max()[True]
if b==max_voteshare:
    return "won"
else:
    return "loss"


Final Code :

 df_andhrapradesh['Candidate Won']=df_andhrapradesh.apply(lambda row:update_candidateresult(df_andhrapradesh,row['Constituency'],row['% of Votes']),axis=1)