Label script for text classification

Hi Team,

need to write a script to populate Y Class Label column from the below table please provide me the script as the out put table as shown below as Label and candidate.


try idxmax() function of dataframe ,wish you good luck!
pd=df[‘Candidate Name’,‘DE’,‘DL’,‘ML’,‘NLP’]
pd.apply(lambda x: x[‘DE’,‘DL’,‘ML’,‘NLP’].idxmax(),axis=1)

1 Like

Thank a ton