I have a dataframe
id key
a1 1
a2 1
a3 1
a4 2
a5 2
a6 3
I want to create a dictionary with key
as machine no, and id
column as list
like:
{1: ['a1', 'a2', 'a3'], 2: ['a4', 'a5'], 3: ['a6']}
Can i use groupby first and then do .to_dict?