Python loops:  Precise way to handle mapping matching lists
<p>A function returns two lists which are logically mapped <strong>one-to-one</strong>. Suppose</p>

<pre><code>name = ["facebook", "twitter", "myspace"]
hits = [4000, 2500, 1800]
</code></pre>

<p>Therefore, hits for facebook are 4000, twitter 2500, and myspace 2500.</p>

<p><strong>I want to convert these two separate lists into a list of dictionaries</strong> like</p>

<pre><code>[
  {name: 'facebook',data: [4000]},
  {name: 'twitter',data: [2500]},
  {name: 'myspace',data: [1800]}
]
</code></pre>

<p><strong>My solution</strong> to do this is:</p>

<pre><code>data = [
    {"name":l, "data":[v]}
    for idx1, l in enumerate(labels)
    for idx2, v in enumerate(values)
    if idx1 == idx2
    ]
</code></pre>

<p>Is there a more <strong>elegant</strong> way of dealing with logical one-to-one mapping or is my solution precise?</p>
