title: Python - Quick way to get specific content from CSV
body: <p>What's the optimal way to get the following from CSV like this:</p>
  <pre><code>student_id,521,597,624,100
  1,99,73,97,98
  2,98,71,70,99
  </code></pre>
  <ol>
  <li>How I can get the exercise numbers (the top row excluding the student_id string)</li>
  <li>How I can get only the grades (99,73,97,98,98,71,70,99)?</li>
  </ol>
  <p>This is what I tried so far:</p>
  <pre><code>def read_students(path):
      try:
          with open(path, 'r') as f:
              exercise_data = list(csv.reader(f, skipinitialspace=True, delimiter=','))
  
          students = []
          exercises = []
          grades = []
  
          i = 0
          for column in exercise_data:
              if column[0] != &quot;student_id&quot;:
                  students.append(column[0])
          return exercises, students, grades
  
      except IOError as exc:
          return exc
  </code></pre>
  <p>Not sure how to get the <code>exercises</code> and <code>grades</code> - the <code>students</code> work.</p>
  <p>expected output:</p>
  <pre><code>&gt;&gt;&gt; exercises, students_ids, grades = read_students('example.csv')
  &gt;&gt;&gt; print('Total exercises, ids, grades:', exercises.shape[0], students_ids.shape[0],
  grades.size)
  Total exercises, ids, grades: 2 4 8
  </code></pre>