Python converting dictionary to dataframe fail
<p>When I try to convert the following dictionary to dataframe, python repeats each row twice.</p>

<pre><code>a = [[[[130.578125, 96, 130.59375, 541],
       [130.5625, 635, 130.609375, 1055],
       [130.546875, 657, 130.625, 1917],
       [130.53125, 707, 130.640625, 1331],
       [130.515625, 1530, 130.65625, 2104]],
      [[130.578125, 96, 130.59375, 541],
       [130.5625, 635, 130.609375, 1055],
       [130.546875, 657, 130.625, 1917],
       [130.53125, 707, 130.640625, 1331],
       [130.515625, 1530, 130.65625, 2104]]],
     [[[143.34375, 5, 143.359375, 79],
       [143.328125, 142, 143.375, 129],
       [143.3125, 132, 143.390625, 137],
       [143.296875, 126, 143.40625, 118],
       [143.28125, 113, 143.421875, 125]],
      [[143.34375, 5, 143.359375, 79],
       [143.328125, 142, 143.375, 129],
       [143.3125, 132, 143.390625, 137],
       [143.296875, 126, 143.40625, 118],
       [143.28125, 113, 143.421875, 125]]]]

b = ['Mini','on']

c = dict(zip(b,a))

d = pd.DataFrame.from_dict(c)

print d
</code></pre>

<p>Python prints the following output:</p>

<pre><code>                                                Mini  \
0  [[130.578125, 96, 130.59375, 541], [130.5625, ...
1  [[130.578125, 96, 130.59375, 541], [130.5625, ...

                                                  on
0  [[143.34375, 5, 143.359375, 79], [143.328125, ...
1  [[143.34375, 5, 143.359375, 79], [143.328125, ...
</code></pre>

<p>The desired output is:</p>

<pre><code>                                                Mini  \
0  [[130.578125, 96, 130.59375, 541], [130.5625, ...

                                                  on
0  [[143.34375, 5, 143.359375, 79], [143.328125, ...
</code></pre>

<p>Can someone please suggest how I can fix this?</p>

<p>Let's start with an example  </p>

<p>You're getting</p>

<pre><code>pd.DataFrame({'Mini': [1, 1], 'on': [2, 2]})
</code></pre>

<p><a href="http://i.stack.imgur.com/dS6Cv.png" rel="nofollow"><img src="http://i.stack.imgur.com/dS6Cv.png" alt="enter image description here"></a></p>

<p>When you want</p>

<pre><code>pd.DataFrame({'Mini': [1], 'on': [2]})
</code></pre>

<p><a href="http://i.stack.imgur.com/Wi9jz.png" rel="nofollow"><img src="http://i.stack.imgur.com/Wi9jz.png" alt="enter image description here"></a></p>

<hr>

<p>You're definition of <code>a</code> is a 2x2x5x4 array in list form.  The first dimension is getting zipped away into the values of the <code>dict</code>.  The second dimension is a list of length 2 and I've just demonstrated what happens when you pass such a dictionary to <code>pd.DataFrame</code>  </p>

<p>To fix it, swap the following line with your previous definition of <code>d</code></p>

<pre><code>    d = pd.Series(c).to_frame().T
</code></pre>

<hr>

<p><strong><em>Response to comment</em></strong><br>
To print entire cell content</p>

<pre><code>with pd.option_context('display.max_colwidth', -1):
    print d
</code></pre>

python pandas dictionary dataframe