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>

<pre><code>dict_shepherd = {'shepherd': []}
for name in dict1:
    dict_shepherd['shepherd'].append(dict1['shepherd'])
</code></pre>

<p>It's worth noting that standard dictionaries don't enforce any ordering of their contents, so looping through the items might not yield them in the same order as they are listed in your example.</p>

python dictionary