I have a DataFrame with a column of player NAMES and a column of player unique IDs. There may be more than one player with the same name (i.e. John Williams), but two unique player IDs (i.e. williamsjo01 & williamsjo02). When I create a dictionary of the two columns, where ever there is a key with multiple values, it only captures the latter value.
I am looking for a way for the keys with multiple values to be a list with multiple values. What I am thinking right now is possibly using a conditional statement such as:
if df['fullName'].value_counts() > 1:
(creates list and appends multiple values to one key)
else:
dict(zip(df['fullName'], df['playerID']
Appreciate the help!