からのキーの中の辞書に分割:は、私は三つの辞書持っている2つの異なる他の辞書
dict1 = {'Name1':'Andrew','Name2':'Kevin'....'NameN':'NameN'}- this would have maximum 20 names
dict2 = {'Travel':'Andrew','Footbal':'Kevin',...'Nhobby':'NameN'}- this would have as many names as there are in dict1
dict3 = {'Travel':'ID01','Footbal':'ID02','Travel':'ID03','Photo':'ID04','Footbal':'ID05','Photo':'ID06','Climbing':'ID07'....}
を私は第3回1がこのように終わるように、三つの辞書を結合したいと思います:
dict3 = {'Andrew':'ID01','Kevin':'ID02','Andrew':'ID03','Kevin':'ID04','Kevin':'ID05','Kevin':'ID06','Andrew':'ID07',....}. Basically the hobbies that are in the dict 2 will be kept while the remaining hobbies will be split among the total number of names with a +1 in the case of an uneven number of hobbies.
ここからMerge dictionaries retaining values for duplicate keysのマージ機能を試しましたが、dict3をすべての名前に均等に分割するのに時間がかかります。
あなたの必要な出力は不可能です。辞書には一意のキーが必要です。 – DeepSpace