title: Create dictionary from CSV where column names are keys
body: <p>I'm trying to read a csv file (actually a tsv, but nvm) and set it as a dictionary where its key are the column names of said csv and the rest of the rows are values for those keys.
  I also have some comments marked by the '#' character, which I intend to ignore:</p>
  <p><em><strong>csv_in.csv</strong></em></p>
  <pre><code>##Some comments
  ##Can ignore these lines
  Location   Form                  Range         &lt;-- This would be the header
  North      Dodecahedron          Limited       &lt;---|
  East       Toroidal polyhedron   Flexible      &lt;------ These lines would be lists
  South      Icosidodecahedron     Limited       &lt;---| 
  </code></pre>
  <p>The main idea is to store them like this:</p>
  <pre><code>final_dict = {'Location': ['North','East','South'], 
  'Form': ['Dodecahedron','Toroidal polyhedron','Icosidodecahedron'],
  'Range': ['Limited','Flexible','Limited']}
  </code></pre>
  <p>So far I could come close like so:</p>
  <p><em><strong>tryercode.py</strong></em></p>
  <pre><code>import csv
  dct = {}
  
  # Open csv file
  with open(tsvfile) as file_in:
  # Open reader instance with tab delimeter
  reader = csv.reader(file_in, delimiter='\t')
  # Iterate through rows 
  for row in reader:
      # First I skip those rows that start with '#'
      if row[0].startswith('#'):
          pass
      elif row[0].startswith('L'):
          # Here I try to keep the first row that starts with the letter 'L' in a separate list
          # and insert this first row values as keys with empty lists inside
          dictkeys_list = []
          for i in range(len(row)):
              dictkeys_list.append(row[i])
              dct[row[i]] = []
      else:
          # Insert each row indexes as values by the quantity of rows
          print('¿?')
  </code></pre>
  <p>So far, the dictionary's skeleton looks fine:</p>
  <pre><code>print(dct)
  {'Location': [], 'Form': [], 'Range': []}
  </code></pre>
  <p>But everything I tried so far failed to append the values to the keys' empty lists the way it is intended. Only could do so for the first row.</p>
  <pre><code>        (...)
      else:
          # Insert each row indexes as values by the quantity of rows
          print('¿?')
          for j in range(len(row)):
              dct[dictkeys_list[j]] = row[j]   # Here I indicate the intented key of the dict through the preoviously list of key names
  </code></pre>
  <p>I searched far and wide stackoverflow but couldn't find it for this way (the code template is inspired by an answer at <a href="https://stackoverflow.com/questions/56132656/what-is-the-best-approach-to-get-first-row-as-key-dictionary-and-rest-of-the-r">this post</a>, but the dictionary is of a different structure.</p>