title: Specify single cell in csv file in python
body: <p>I am struggling with one piece of this code and can not seem to get it right. I am attempting to access and print a single cell value from a csv in python. I have the list of rows and columns to specify each single cell but face index errors when I attempt to turn the file into a list and then specify[row][column]. Is there anyway I can get the single cell str values without using pandas? I would prefer to use the csv module if possible</p>
  
  <pre><code>import csv
  from csv import reader
  import json
  
  categories = { '1':'Unacceptable', '2':'Edit'}
  
  def get_annotation_input():
      while True:
          try:
              annotation = int(input("Annotation: "))
              if annotation not in range (1,3):
                  raise ValueError
              return annotation
          except ValueError:
              print("Enter 1 or 2") 
  
  
  def annotate():
      annotator = input("What is your name? ")
      print(''.join(["-"]*50))
  
      with open('annotations_full.csv', 'rU') as infile:
                response_reader = csv.DictReader(infile)
                responses = {}
                for row in response_reader:
                    for header, response in row.items():
                        try:
                            responses[header].append(response)
                        except KeyError:
                            responses[header] = [response]
  
  
                for i in range(len(ROWS)):
                    ROWS[i] = int(ROWS[i])
                COLUMNS = responses['question_number']
                csv_file = csv.reader(open('results.csv'))
                header = next(csv_file)
                text_question = next(csv_file)
                for i in range(len(COLUMNS)):
                    COLUMNS[i] = (header.index(COLUMNS[i]))
                #print(ROWS,COLUMNS)
  
                for i,j in zip(ROWS,COLUMNS):
                    current_row = i
                    current_column = j
                    print("Current row number: ", current_row)
                    print("Annotate the following answer as 1-Unacceptable, 2-Edit")
                    print(header[current_column])
                    print(text_question[current_column], '\n')
                    #WANT TO PRINT SINGLE SPECIFIED CELL TEXT[CURRENT_ROW][CURRENT COLUMN] FROM CSV HERE 
                    annotation = get_annotation_input()
                    if annotation == 2:
                        edited_response = input("Edit the response: " )
                    else:
                        edited_response = "CAN NOT BE EDITED"
  
                        with open("annotations.json", mode='a') as annotation_file:
                            annotation_data = {'annotator' : annotator, 'row_number': current_row, 'question_number': header[current_column], 'annotation' : categories[str(annotation)], 'edited' : edited_response}
                            json.dump(annotation_data, annotation_file)
                            annotation_file.write('\n')
  
  
  
  if __name__ == "__main__":
      annotate()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/xATtX.png" rel="nofollow noreferrer">CSV file 'annotations_full.csv </a>
  <a href="https://i.stack.imgur.com/wNHtu.png" rel="nofollow noreferrer">CSV file 'results.csv'</a></p>