How to convert CSV to a more structured dictionary in python?
<p>Assuming I have the following CSV:</p>

<pre><code>Type   Name        Application  

Vegetable   Lettuce    StoreA
Fruit       Apple      StoreB
Vegetable   Orange     StoreB
Fruit       Pear       StoreC
Dairy       Milk       StoreA
Fruit       Plum       StoreB
Fruit       Plum       StoreA
</code></pre>

<p>Is there some easy way in python to allow me to generate a structured dict based on certain fields I expect to be "collapsed?" For example, by specifying "Type", then "Application", then "Name", in that order... It would create a dict with only three Keys "Vegetable", "Fruit", "Dairy"...</p>

<p>Vegetable would only have "StoreA" and "StoreB" 
Fruit would have "Store B" and "Store C" (no duplicate Store B even though Plum is in Store B)</p>

<p>and drilling to the deepest level of the dict would be the fruit. What is the best way to accomplish this? Syntax is appreciated.</p>
