title: Scala using map after a groupBy
body: <p>Given this code </p>
  
  <pre><code>val list = List(
      Person("John", "Paris", 1956);
      Person("Jane", "London", 1954);
      Person("James", "Paris", 1972);
      Person("Marie", "London", 1959);
  )
  </code></pre>
  
  <p>I want to create a map(key->value), in which the key is the city, and the value is the average age of the persons living in that city. </p>
  
  <p>I have used the groupBy method : </p>
  
  <pre><code>val groupedByCity = list.groupBy(_.city);
  </code></pre>
  
  <p>Which give me this : </p>
  
  <pre><code>Map(Paris -&gt; List(Person(Jonh, Paris, 1956), Person(James, Paris, 1972)), London -&gt; List( Person(Jane, London, 1954), Person(Marie, London, 1959)));
  </code></pre>
  
  <p>How can I remap this to filter the information I need, which is the average age by city ? </p>
  
  <p>Thank you for your help. </p>