title: Find average of a specific number of rows/columns in VB.Net Datatable and store to array
body: <p>I am trying to program a noise reduction algorithm that works with a set of datapoints in a VB.NET DataTable after being helped with <a href="https://stackoverflow.com/questions/11118678/convert-csv-data-to-datatable-in-vb-net">my other question</a>. Basically, I want to take two integers, a coordinate value (<code>yCoord</code> for example) and a threshold smoothing value (<code>NoiseThresh</code>), and take the average of the values in the range of <code>(yCoord - NoiseThresh, yCoord + NoiseThresh)</code> and store that number into an array. I'd repeat that process for each column (in this example) and end up with a one-dimensional array of average values. My questions are:</p>
  
  <p>1) Did anything I just say make any sense ;), and<br>
  2) Can anyone help me with the code? I've got very little experience working with databases.</p>
  
  <p>Thanks!</p>
  
  <p>An example of what I'm trying to do:</p>
  
  <pre><code>//My data (pretend it's a database)
  1  4  4  9  2  //yCoord would equal 5
  6  3  8  12 3  //yCoord = 4
  8  3 -2  2  0  //yCoord = 3
  9 17  3  7  5  //yCoord = 2
  4  1  0  9  7  //yCoord = 1
  
  //In this example, my yCoord will equal 3 and NoiseThresh = 1
  
  //For the first column
      Array(column1) = //average of the set of numbers centered at yCoord = 3 _
  //(in this case 8) and the NoiseThresh=1 number on either side (here 6 &amp; 9)
  //For the second column
      Array(column2) = //average of the numbers 3,3,17 for example
      //etc., etc.,
  </code></pre>
  
  <p>This would be performed on a large data set (typical numbers would be yCoord=500, NoiseThresh = 50, Array length = 1092) so there is no possibility of manually entering the numbers.</p>
  
  <p>I hope this helps clarify my question!</p>
  
  <p>P.S.: yes, I know that // isn't a VB.NET comment.</p>