列 1 から重複を削除し、Python を使用して各一意のアイテムに関連付けられた値の関連リストを列 2 に返したいと思います。
入力は
1 2
Jack London 'Son of the Wolf'
Jack London 'Chris Farrington'
Jack London 'The God of His Fathers'
Jack London 'Children of the Frost'
William Shakespeare 'Venus and Adonis'
William Shakespeare 'The Rape of Lucrece'
Oscar Wilde 'Ravenna'
Oscar Wilde 'Poems'
出力は
1 2
Jack London 'Son of the Wolf, Chris Farrington, Able Seaman, The God of His Fathers,Children of the Frost'
William Shakespeare 'The Rape of Lucrece,Venus and Adonis'
Oscar Wilde 'Ravenna,Poems'
2 番目の列には、各項目に関連付けられた値の合計が格納されます。辞書で set() 関数を試しました
dic={'Jack London': 'Son of the Wolf', 'Jack London': 'Chris Farrington', 'Jack London': 'The God of His Fathers'}
set(dic)
しかし、辞書の最初のキーのみを返しました
set(['Jack London'])