title: catalogue a list of dictionaries
body: <p>I have a list of dictionaries:</p>
  
  <pre><code>people = [{"name": "Roger", "city": "NY", "age": 20, "sex": "M"},
            {"name": "Dan", "city": "Boston", "age": 20, "sex": "M"},
            {"name": "Roger", "city": "Boston", "age": 21, "sex": "M"},
            {"name": "Dana", "city": "Dallas", "age": 30, "sex": "F"}]
  </code></pre>
  
  <p>I want to catalogue them, for example I choose these keys:</p>
  
  <pre><code>field = ("sex", "age")
  </code></pre>
  
  <p>I need a function <code>catalogue(field, people)</code> that give me:</p>
  
  <pre><code>{ "M": 
        { 20: [{"name": "Roger", "city": "NY", "age": 20, "sex": "M"},
               {"name": "Dan", "city": "Boston", "age": 20, "sex": "M"}],
          21: [{"name": "Roger", "city": "Boston", "age": 21, "sex": "M"}]
        },
   { "F":
        { 30: [{"name": "Dana", "city": "Dallas", "age": 30, "sex": "F"}] }
   }
  </code></pre>
  
  <p>when <code>len(field)==1</code> it's simple. I want to do something like this:</p>
  
  <pre><code>c = catalogue(field, people)
  for (sex, sex_value) in c.iteritems():
     for (age, age_value) in sex_value.iteritems():
         print sex, age, age_value["name"]
  </code></pre>