title: PYTHON grouping dictionary in array
body: <p>I'm trying to summarize and grouping multiple dictionary into single dictionary in array based on the dictionary's value. Also, get the count of the grouping value.</p>
  
  <p>For example in the raw input format of 'sms', i intend to group by subscribe_name ,endpoint ,errorId and get its count. </p>
  
  <p>I have no much idea where to start and hope some guidelines from here and library resource can be utilised.</p>
  
  <p>Desired payload format:</p>
  
  <pre><code>{
      "myDeviceX": {
          "channel": {
              "sms": [
                  {
                      "endpoint": "+123456789",
                      "errorId": ["1","2","3","4"],
                      "error_num": 4,
                      "subscriber_name": "tester1"
                  },
                  {
                      "endpoint": "+234567890",
                      "errorId": ["1"],
                      "error_num": 1,
                      "subscriber_name": "tester2"
                  }
              ],
              "email": [
                  {
                      "endpoint": "xxx@gmail.com",
                      "errorId": ["1","2","3"],
                      "error_num": 3,
                      "subscriber_name": "tester1"
                  }
              ]
          }
      }
  }
  </code></pre>
  
  <p>Raw input payload format:</p>
  
  <pre><code>{
      "myDeviceX": {
          "sms": [
              {
                  "endpoint": "+123456789",
                  "errorId": "1",
                  "subscriber_name": "tester1"
              },
              {
                  "endpoint": "+123456789",
                  "errorId": "2",
                  "subscriber_name": "tester1"
              },
              {
                  "endpoint": "+123456789",
                  "errorId": "3",
                  "subscriber_name": "tester1"
              },
              {
                  "endpoint": "+123456789",
                  "errorId": "4",
                  "subscriber_name": "tester1"
              },
              {
                  "endpoint": "+234567890",
                  "errorId": "1",
                  "subscriber_name": "tester2"
              }
          ],
          "email": [
              {
                  "endpoint": "xxx@gmail.com",
                  "errorId": "1",
                  "subscriber_name": "tester1"
              },
              {
                  "endpoint": "xxx@gmail.com",
                  "errorId": "2",
                  "subscriber_name": "tester1"
              },
              {
                  "endpoint": "xxx@gmail.com",
                  "errorId": "3",
                  "subscriber_name": "tester1"
              }
          ]
      }
  }
  </code></pre>