Pandas Columns to Dict Preserving Order
<p>Given the following data frame:</p>

<pre><code>df = pd.DataFrame({'a':['a','c','b'],
                   'b':['foo','bar','baz']})
df
    a   b
0   a   foo
1   c   bar
2   b   baz
</code></pre>

<p>When I create a dict from the columns, I get this:</p>

<pre><code>dict(zip(df.a,df.b))
{'a': 'foo', 'b': 'baz', 'c': 'bar'}
</code></pre>

<p>You'll notice that it sorts the key column (a) automatically.</p>

<p>My question is: How do I avoid this?</p>

<p>I'd like a dict that looks like this:</p>

<pre><code>{'a': 'foo', 'c': 'bar', 'b': 'baz', }
</code></pre>

<p>Thanks in advance!</p>