title: Calculate average in list of tuples F#
body: <p>I have a text file of rain measured over 3 years, where each number after the year corresponds to the month. 
  For example, in </p>
  
  <pre><code>2002    1.17    0.78    7.11    5.17    5.84    4.29    1.12    4.06    1.9 2.07    1.47    1.53
  2001    1.24    3.22    1.61    3.33    6.55    2.4 3.5 1.32    3.9 6.04    1.69    1.13
  2000    1.277   1.4 1.17    5.74    6.48    4.81    4.07    3.19    6.2 1.95    2.65    1.7
  </code></pre>
  
  <p>In 2002, Average rainfall in Feb was 0.78.</p>
  
  <p>I made a list of tuples called mylist, in the format (year,values,average,min,max) where years is int, values is a float list, average is an int that averages all of 'values', min is an int holding the smallest 'value' and max.</p>
  
  <p><em>My question:</em>
  <strong>How do I calculate the average of the n'th elements in the list, like the average of month January, Feb, March...</strong>.</p>
  
  <p>I have:</p>
  
  <pre><code> let months = [ "Jan"; "Feb"; "Mar"; "Apr"; "May"; "Jun"; "Jul"; "Aug"; "Sep"; "Oct"; "Nov"; "Dec" ] //string list
  </code></pre>
  
  <p>and I'm thinking of something along the lines of:</p>
  
  <pre><code>mylist |&gt; List.map (fun (_,values, _, _, _) -&gt; average 0th index across all tuples, print Jan, then average 1st index across all tuples, print Feb, etc...)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>mylist |&gt; List.map (fun (_,values, _, _, _) -&gt; printfn"%A %A" List.average 0thIndex,0thMonth....List.average 1stIndex, 1stMonth, etc...)
  </code></pre>
  
  <p>But I'm not familiar enough with the functional language to know all operations on lists and maps. Am more comfortable with Java and C</p>