title: Reading a csv file and counting a row depending on another row
body: <p>I have a csv file where i need to read different columns and sum their numbers up depending on another row in the dataset.<br>
  The question is:</p>
  
  <blockquote>
    <p>How do the flight phases (ex. take off, cruise, landing..) contribute
    to fatalities?</p>
  </blockquote>
  
  <p>I have to sum up column number 23 for each different data in column 28.</p>
  
  <p>I have a solution with masks and a lot of IF statements:</p>
  
  <pre><code>database = pd.read_csv('Aviation.csv',quotechar='"',skipinitialspace=True, delimiter=',', encoding='latin1').fillna(0)
  data = database.as_matrix()
  
  TOcounter = 0
  
  for r in data:
      if r[28] == "TAKEOFF":
          TOcounter += r[23]
  print(TOcounter)
  </code></pre>
  
  <p>This example shows the general idea of my solution. Where i would have to add a lot of if statements and counters for every different data in column 28. 
  But i was wondering if there is a smarter solution to the issue.<br>
  The raw data can be found at: <a href="https://raw.githubusercontent.com/edipetres/Depressed_Year/master/Dataset_Assignment/AviationDataset.csv" rel="nofollow noreferrer">https://raw.githubusercontent.com/edipetres/Depressed_Year/master/Dataset_Assignment/AviationDataset.csv</a></p>