ValueError: need more than 2 values to unpack
<p>I am doing this operation:</p>

<pre><code>for model, dict in fullCostDict.items():
        if dict['cost_matrix']:

            for i, (costDict, normalCostDict, normalCostDict1, normalCostDict2,normalCostDict3,normalCostDict4) in enumerate(
                    zip(dict['cost_matrix'], dict['normalised_matrix'],dict['normalised_matrix_sum'],dict['normalised_matrix_sumSquared'],dict['normalised_matrix_sumExp'],dict['normalised_matrix_sigmoid'])):

                for count, (lb, cost),(lb1, cost1),(lb2, cost2),(lb3, cost3),(lb4, cost4),(lb5, cost5) in enumerate(zip(costDict.items(),normalCostDict.items(),normalCostDict1.items(),normalCostDict2.items(),normalCostDict3.items(),normalCostDict4.items())):
</code></pre>

<p>On this array:</p>

<pre><code>fullCostDict = {
'open_cost_2': {
    'normalised_matrix': [
        {
            'a': 0.0,
            'c': 0.9318755256518082,
            'b': 1.0
        },
        {
            'a': 0.1,
            'c': 0.0,
            'b': 1.0
        },
        {
            'a': 0.016098839385997755,
            'c': 0.0,
            'b': 1.0
        }
    ],
    'normalised_matrix_sum': [
        {
            'a': 0.046136534133533386,
            'c': 0.4617404351087772,
            'b': 0.49212303075768943
        },
        {
            'a': 0.2637620662666319,
            'c': 0.23767284111661885,
            'b': 0.4985650926167493
        },
        {
            'a': 0.06399035455925695,
            'c': 0.050549254264535146,
            'b': 0.8854603911762079
        }
    ],
    'normalised_matrix_sumExp': [
        {
            'a': 4.695521542065545e-52,
            'c': 4.699339039254216e-51,
            'b': 5.0085563115365814e-51
        },
        {
            'a': 3.37e-08,
            'c': 3.036666666666667e-08,
            'b': 6.37e-08
        },
        {
            'a': 4.7766666666666664e-08,
            'c': 3.7733333333333334e-08,
            'b': 6.609666666666667e-07
        }
    ],
    'cost_matrix': [
        {
            'a': 123,
            'c': 1231,
            'b': 1312
        },
        {
            'a': 1011,
            'c': 911,
            'b': 1911
        },
        {
            'a': 1433,
            'c': 1132,
            'b': 19829
        }
    ],
    'normalised_matrix_sumSquared': [
        {
            'a': 3.782480901546635e-05,
            'c': 0.00037855560892714697,
            'b': 0.0004034646294983077
        },
        {
            'a': 0.00018368582782987458,
            'c': 0.0001655171010415586,
            'b': 0.0003472043689247184
        },
        {
            'a': 3.613903429449092e-06,
            'c': 2.854807175252179e-06,
            'b': 5.000704194176277e-05
        }
    ],
    'normalised_matrix_sigmoid': [
        {
            'a': 1.0,
            'c': 1.0,
            'b': 1.0
        },
        {
            'a': 1.0,
            'c': 1.0,
            'b': 1.0
        },
        {
            'a': 1.0,
            'c': 1.0,
            'b': 1.0
        }
    ]
},
'open_cost_1': {
    'normalised_matrix': [
        {
            'a': 0.0,
            'c': 1.0,
            'b': 0.5925925925925926
        },
        {
            'a': 0.0,
            'c': 1.0,
            'b': 0.05562060889929742
        },
        {
            'a': 0.0,
            'c': 1.0,
            'b': 0.0009238586496266071
        }
    ],
    'normalised_matrix_sum': [
        {
            'a': 0.1518987341772152,
            'c': 0.4936708860759494,
            'b': 0.35443037974683544
        },
        {
            'a': 0.0016556291390728477,
            'c': 0.9442604856512141,
            'b': 0.05408388520971302
        },
        {
            'a': 9.306716534258754e-06,
            'c': 0.9990584064147736,
            'b': 0.0009322868686921517
        }
    ],
    'normalised_matrix_sumExp': [
        {
            'a': 3.200675556312609e-33,
            'c': 1.0402195558015979e-32,
            'b': 7.468242964729421e-33
        },
        {
            'a': 8.246355023730644e-43,
            'c': 4.703171148534378e-40,
            'b': 2.6938093077520104e-41
        },
        {
            'a': 3.413131807036764e-51,
            'c': 3.66393239921894e-46,
            'b': 3.4190554242225303e-49
        }
    ],
    'cost_matrix': [
        {
            'a': 24,
            'c': 78,
            'b': 56
        },
        {
            'a': 3,
            'c': 1711,
            'b': 98
        },
        {
            'a': 121,
            'c': 12989121,
            'b': 12121
        }
    ],
    'normalised_matrix_sumSquared': [
        {
            'a': 0.002449979583503471,
            'c': 0.007962433646386281,
            'b': 0.0057166190281747655
        },
        {
            'a': 1.021403858319028e-06,
            'c': 0.000582540667194619,
            'b': 3.336585937175491e-05
        },
        {
            'a': 7.171755367615439e-13,
            'c': 7.698743657219539e-08,
            'b': 7.18420221577411e-11
        }
    ],
    'normalised_matrix_sigmoid': [
        {
            'a': 0.99999999996224864,
            'c': 1.0,
            'b': 1.0
        },
        {
            'a': 0.95257412682243336,
            'c': 1.0,
            'b': 1.0
        },
        {
            'a': 1.0,
            'c': 1.0,
            'b': 1.0
        }
    ]
},
'open_cost_threshold': {
    'normalised_matrix': [
        {
            'a': 0.0,
            'b': 1.0
        },
        {
            'a': 0.1,
            'b': 1.0
        },
        {
            'a': 0.016098839385997755,
            'b': 1.0
        }
    ],
    'normalised_matrix_sum': [
        {
            'a': 0.046136534133533386,
            'b': 0.49212303075768943
        },
        {
            'a': 0.2637620662666319,
            'b': 0.4985650926167493
        },
        {
            'a': 0.06399035455925695,
            'b': 0.8854603911762079
        }
    ],
    'normalised_matrix_sumExp': [
        {
            'a': 4.695521542065545e-52,
            'b': 5.0085563115365814e-51
        },
        {
            'a': 3.37e-08,
            'b': 6.37e-08
        },
        {
            'a': 4.7766666666666664e-08,
            'b': 6.609666666666667e-07
        }
    ],
    'cost_matrix': [
        {
            'a': 123,
            'b': 1312
        },
        {
            'a': 1011,
            'b': 1911
        },
        {
            'a': 1433,
            'b': 19829
        }
    ],
    'normalised_matrix_sumSquared': [
        {
            'a': 3.782480901546635e-05,
            'b': 0.0004034646294983077
        },
        {
            'a': 0.00018368582782987458,
            'b': 0.0003472043689247184
        },
        {
            'a': 3.613903429449092e-06,
            'b': 5.000704194176277e-05
        }
    ],
    'normalised_matrix_sigmoid': [
        {
            'a': 1.0,
            'b': 1.0
        },
        {
            'a': 1.0,
            'b': 1.0
        },
        {
            'a': 1.0,
            'b': 1.0
        }
    ]
},
'open_cost_1': {
    'normalised_matrix': [
        {
            'a': 0.0,
            'b': 0.5925925925925926
        },
        {
            'a': 0.0,
            'b': 0.05562060889929742
        },
        {
            'a': 0.0,
            'b': 0.0009238586496266071
        }
    ],
    'normalised_matrix_sum': [
        {
            'a': 0.1518987341772152,
            'b': 0.35443037974683544
        },
        {
            'a': 0.0016556291390728477,
            'b': 0.05408388520971302
        },
        {
            'a': 9.306716534258754e-06,
            'b': 0.0009322868686921517
        }
    ],
    'normalised_matrix_sumExp': [
        {
            'a': 3.200675556312609e-33,
            'b': 7.468242964729421e-33
        },
        {
            'a': 8.246355023730644e-43,
            'b': 2.6938093077520104e-41
        },
        {
            'a': 3.413131807036764e-51,
            'b': 3.4190554242225303e-49
        }
    ],
    'cost_matrix': [
        {
            'a': 24,
            'b': 56
        },
        {
            'a': 3,
            'b': 98
        },
        {
            'a': 121,
            'b': 12121
        }
    ],
    'normalised_matrix_sumSquared': [
        {
            'a': 0.002449979583503471,
            'b': 0.0057166190281747655
        },
        {
            'a': 1.021403858319028e-06,
            'b': 3.336585937175491e-05
        },
        {
            'a': 7.171755367615439e-13,
            'b': 7.18420221577411e-11
        }
    ],
    'normalised_matrix_sigmoid': [
        {
            'a': 0.99999999996224864,
            'b': 1.0
        },
        {
            'a': 0.95257412682243336,
            'b': 1.0
        },
        {
            'a': 1.0,
            'b': 1.0
        }
    ]
}
</code></pre>

<p>}</p>

<p>As you can see, I am trying to get to the key,value pairs of each dictionary with the list of dictionaries of each different type of <code>cost_matrix</code> within the full dictionary. What am I doing wrong here? Note, some of the inner dictionaries have different lengths (some have <code>a</code> and <code>b</code>, so 2 items, some have <code>a</code>,<code>b</code> and <code>c</code>, so 3 items).</p>

<p>You are missing a paranthesis in last <code>for</code> loop. Though you expect a <code>count</code> and a tuple of tuples, you are getting a bunch of tuple. So, the fix would be adding a pair of <code>()</code> over the tuples.</p>

<pre><code>                for count, ((lb, cost),(lb1, cost1),(lb2, cost2),(lb3, cost3),(lb4, cost4),(lb5, cost5)) in enumerate(.......
                           ^                                                                           ^    
</code></pre>

python loops dictionary zip enumerate