title: Aggregation json by elements of sub-json
body: <p>I have the following structure:</p>
  
  <pre><code>[
      {
          "Name": "a-1",
          "Tags": [
              {
                  "Value": "a", 
                  "Key": "Type"
              }
          ], 
          "CreationDate": "2018-02-25T17:33:19.000Z"
      },
      {
          "Name": "a-2",
          "Tags": [
              {
                  "Value": "a", 
                  "Key": "Type"
              }
          ], 
          "CreationDate": "2018-02-26T17:33:19.000Z"
      },
      {
          "Name": "b-1",
          "Tags": [
              {
                  "Value": "b", 
                  "Key": "Type"
              }
          ], 
          "CreationDate": "2018-01-21T17:33:19.000Z"
      },
      {
          "Name": "b-2",
          "Tags": [
              {
                  "Value": "b", 
                  "Key": "Type"
              }
          ], 
          "CreationDate": "2018-01-22T17:33:19.000Z"
      },
      {
          "Name": "c-1",
          "Tags": [
              {
                  "Value": "c", 
                  "Key": "Type"
              }
          ], 
          "CreationDate": "2018-08-29T17:33:19.000Z"
      }
  ]
  </code></pre>
  
  <p>I want to print out the oldest <code>Name</code> of each <code>Value</code> when there are more than one member in the group (This should be configurable. For example: The x oldest items when there are more than y members). In this case there are two <code>a</code>, two <code>b</code> and one <code>c</code>, So the expected result will be:</p>
  
  <pre><code> a-1
   b-1
  </code></pre>
  
  <p>Here if my Python code:</p>
  
  <pre><code>data = ec2.describe_images(Owners=['11111'])
  images = data['Images']
  grouper = groupby(map(itemgetter('Tags'), images))
  groups = (list(vals) for _, vals in grouper)
  res = list(chain.from_iterable(filter(None, groups)))
  </code></pre>
  
  <p>Currently <code>res</code> contains only list of <code>Key</code> and <code>Value</code> and it's not grouped by. Any one can show my how to continue the code to the expected result?</p>