title: How to get the first column's contents from a 2D array
body: <p>How can I pull the first column from my 2D array? I am initialising my array in a method like this </p>
  
  <pre><code>//Initialise the array with the values from the file
  public static float[][] data(float[][] data, Scanner scan){
      int count = 0; 
  
      for (int i=0;i&lt;data.length;i++){
          for (int j=0;j&lt;data[0].length;j++){
              count++;    
              if(count&lt;data.length*data[0].length){
                  for(int k=0;k&lt;2; k++){
  
                      data[i][j] = (float)   IOUtil.skipToDouble(scan); 
                      System.out.print(data[i][j] + "  ");    
                  }
  
              System.out.println();
              }   
          }
  
      }
      return data;    
  
  }
  </code></pre>
  
  <p>This is the contents of my test file. (Please bare in mind the file could be any length) </p>
  
  <pre><code>13.97  2.2  
  12.05  1.9  
  9.99  1.5  
  8.0  1.3  
  6.0  0.9  
  4.0  0.6  
  2.0  0.3  
  0.0  0.0  
  -2.0  -0.3  
  -4.0  -0.6  
  -6.02  -0.9  
  -8.0  -1.3  
  -9.99  -1.6  
  -12.03  -1.9  
  -13.98  -2.2
  </code></pre>
  
  <p>on the terminal but the problem is when I try to call the left column I am getting the right column. I am not sure if this is because the values on the right are the only ones getting stored or not.</p>
  
  <pre><code>      //should print x but actually prints y 
     public static void printX(float[][] data){
  
          for (int i=0;i&lt;data.length;i++){
              for (int j=0;j&lt;data[0].length;j++){
  
                  System.out.println(data[i][j]);
              }
          }
      }
  </code></pre>
  
  <p>which outputs</p>
  
  <pre><code>2.2
  1.9
  1.5
  1.3
  0.9
  0.6
  0.3
  0.0
  -0.3
  -0.6
  -0.9
  -1.3
  -1.6
  -1.9
  -2.2
  0.0
  </code></pre>
  
  <p>Can anyone clarify how I could best get the data on the left hand column from the 2D array ? Or if there is some other method for achieving this sort of thing? </p>