how to get a new column for the majority of each group?
sample dataframe
who state
0 peopleA CA
1 peopleA CA
2 peopleA CA
3 peopleA NJ
4 peopleB FL
5 peopleB FL
6 peopleB CA
this's not the right way to code
df['new_column'] = df.groupby('who').mode()
my expected output
who new_column
0 peopleA CA
1 peopleB FL
Bonus question: Is there a way to set a threshold to control if the count greater than 70%, then consider as majority, if less than 70%, return null