title: How to call values by column name after reading in CSV
body: <p>I have read in a csv by saving each element of a row to the listed column name variables.</p>
  <p>For example:</p>
  <pre><code>data = []
  
  with open('sample.txt', 'r') as file:
      for line in file.readlines():
          col1, col2, col3 = line.split('\t')
          data.append([col1, col2, col3])
  
  </code></pre>
  <p>Now, if I want to perform some operation on a specific column in <code>data</code>, such as <code>col1</code>, how could I do that?</p>
  <p>The below code does not work:</p>
  <pre><code>for line in data:
      print(col1)
  </code></pre>
  <p>Instead, I would need to hardcode the line element in question, likeso:</p>
  <pre><code>for line in data:
      print(line[0])
  </code></pre>
  <p>I thought that because I read the csv in a way that I defined <code>col1</code>, <code>col2</code>, and <code>col3</code> that I should be able to call upon the elements of my list that correspond to these column names.</p>
  <p>Is it possible to do this? I do not want to use imported modules/packages (like pandas).</p>