title: Netlogo: How to subset with row and column indexes
body: <p>Could someone help me out with the code on reading in data in <code>Netlogo</code>? I am trying to choose one element in multiple lists to assign it to the turtle as a variable (I have the data in a rectangular table read from a csv file).</p>
  <p>In my current code, it reads as I want but the problem is it is reading only elements of one last row instead of iteratively reading elements (across columns) of all rows. What I need is to read one element of each row at a time.</p>
  <p><a href="https://i.stack.imgur.com/hXJOA.png" rel="nofollow noreferrer">here are some rows of my data</a></p>
  <p>Here is what I have tried so far:</p>
  <pre><code>let residents-file &quot;mock-data.csv&quot;
    let residents-list []
    set residents-list csv:from-file residents-file
    
    
    foreach residents-list [ ?1 -&gt;
      let hh-col ?1row
      let residents-to-create 1 
      
      create-residents residents-to-create [ setxy random-xcor random-ycor ]    
      ask residents [ 
        set shape &quot;person&quot;
        set color 9
        set ID item 0 hh-col
        set occupancy item 1 hh-col]]
  </code></pre>