df['majority_vote'] = df.groupby(['Class'])['Grade'].transform(lambda x: x.mode()[0]) ... Thank you in advance. python · dataframe · mode.
確定! 回上一頁