title: dynamically deducing whether a csv/txt file has headers and skip if necessary
body: <p>I am working on computer vision and often need to use codes like</p>
  
  <pre><code>with open(csv or txt file, "r") as input_file:
      headers = next(input_file)
      for row in input_file:
          image_name, x_min_norm, y_min_norm, x_max_norm, y_max_norm, class_idx = row.split(",")
  </code></pre>
  
  <p>However, I am not from computer science background and want to ask this naive question:</p>
  
  <p>Question 1: Sometimes the csv/txt file given to me has headers like "img_name, xmin, ymin etc etc", and sometimes the files do not have headers. It is most often the case that I need to skip the headers to iterate through the rest of the data, but <strong>what if</strong> there are no headers in the files given, then it will skip my first row right? How do I fix this?</p>
  
  <p>Question 2: when I want to row.split, I noticed in csv, sometimes it is row.split(", ") and sometimes its row.split(","). Is there a reason why?</p>