Looping over a dictionary to make multiple dictionaries
<p>I have a dictionary, dict1, and I am wanting to find a way to loop through it to isolate all the values for shepherds, collies, and poodles. I apologize a head of time if my syntax is off. I am still learning about dictionaries!</p>

<pre><code>dict1 = {
'Bob VS Sarah': {
    'shepherd': 1,
    'collie': 5,
    'poodle': 8
},
'Bob VS Ann': {
    'shepherd': 3,
    'collie': 2,
    'poodle': 1
},
'Bob VS Jen': {
    'shepherd': 3,
    'collie': 2,
    'poodle': 2
},
'Sarah VS Bob': {
    'shepherd': 3,
    'collie': 2,
    'poodle': 4
},
'Sarah VS Ann': {
    'shepherd': 4,
    'collie': 6,
    'poodle': 3
},
'Sarah VS Jen': {
    'shepherd': 1,
    'collie': 5,
    'poodle': 8
},
'Jen VS Bob': {
    'shepherd': 4,
    'collie': 8,
    'poodle': 1
},
'Jen VS Sarah': {
    'shepherd': 7,
    'collie': 9,
    'poodle': 2
},
'Jen VS Ann': {
    'shepherd': 3,
    'collie': 7,
    'poodle': 2
},
'Ann VS Bob': {
    'shepherd': 6,
    'collie': 2,
    'poodle': 5
},
'Ann VS Sarah': {
    'shepherd': 0,
    'collie': 2,
    'poodle': 4
},
'Ann VS Jen': {
    'shepherd': 2,
    'collie': 8,
    'poodle': 2
},
'Bob VS Bob': {
    'shepherd': 3,
    'collie': 2,
    'poodle': 2
},
'Sarah VS Sarah': {
    'shepherd': 3,
    'collie': 2,
    'poodle': 2
},
'Ann VS Ann': {
    'shepherd': 13,
    'collie': 2,
    'poodle': 4
},
'Jen VS Jen': {
    'shepherd': 9,
    'collie': 7,
    'poodle': 2
 }
}
</code></pre>

<p>This is what I want, for example, but to be able to loop through to make a dictionary for each dog:</p>

<p>dict_shepherd = {'shepherd': 1,3,3,3,4,1,4,7,3,6,0,2,3,3,13,9}</p>

<p>Note: I still have not touched base with pandas and prefer help without using them :) I will get to them one day.</p>

<p>You can also get all the lists in one line using dictionary and list comprehensions:</p>

<pre><code>ds = {type: [val[type] for val in dict1.values()] for type in ['shepherd', 'collie', 'poodle']}

# {'collie': [2, 7, 8, 5, 2, 6, 5, 2, 2, 2, 2, 8, 9, 2, 2, 7],
#  'poodle': [2, 2, 1, 8, 2, 3, 8, 5, 4, 1, 2, 2, 2, 4, 4, 2],
#  'shepherd': [3, 9, 4, 1, 3, 4, 1, 6, 3, 3, 3, 2, 7, 0, 13, 3]}
</code></pre>

<p>However, the lists are in no particular order because a <code>dict</code> has no order.</p>

python dictionary