title: loading a dataframe from a sparse dictionary efficiently
body: <p>I have a python dictionary that looks like this :</p>
  <pre class="lang-py prettyprint-override"><code>dict_df={
  &quot;hello&quot;:
       {&quot;doc-1&quot;: 0,
        &quot;doc-2&quot;: 1,
        &quot;doc-3&quot;: 2
        },
   &quot;hi&quot;:
       {&quot;doc-3&quot;: 0,
        &quot;doc-4&quot;: 6,
        &quot;doc-5&quot;: 2
        },
   &quot;other-word&quot;:
       {&quot;doc-6&quot;: 7,
        &quot;doc-7&quot;: 1,
        &quot;doc-8&quot;: 5
        }
  
   }
  </code></pre>
  <p>I want to generate a dataframe with this dictionary</p>
  <pre><code>pandas.Dataframe(dict_df) 
  </code></pre>
  <p>It works great in this exemple :</p>
  <pre><code>       hello   hi  other-word
  doc-1    0.0  NaN         NaN
  doc-2    1.0  NaN         NaN
  doc-3    2.0  0.0         NaN
  doc-4    NaN  6.0         NaN
  doc-5    NaN  2.0         NaN
  doc-6    NaN  NaN         7.0
  doc-7    NaN  NaN         1.0
  doc-8    NaN  NaN         5.0
  </code></pre>
  <p>However on large dict takes a lot of time and a lot of memory (but I want to keep NaNs values !)</p>
  <p>How to optimize the memory and the construction time of the dataframe ?</p>