Session Ready
Exercise

Finding certain rows in a DataFrame

Bird strikes by aircraft are both dangerous to human life and of great concern to conservation efforts. Luckily, the Federal Aviation Administration has been tracking wildlife strikes for nearly 30 years.

You're going to use for loops to explore the FAA Wildlife Strikes database. A pandas DataFrame that contains wildlife strikes by aircraft in California recorded from 1990 to 2018 is loaded into your session. You want to find incidences that involve Snowy egrets, a migratory bird that winters in California. For each incident, display:

  • Date of incident (INCIDENT_DATE column)
  • Airport (AIRPORT column)
  • Type of aircraft (ATYPE column)
  • Severity of the damage (DAMAGE column)
Instructions
100 XP
  • Print the first five lines of the wildlife_strikes DataFrame.
  • Construct a for loop that iterates through each row of wildlife_strikes.
  • Create a conditional statement that determines if SPECIES is a 'Snowy egret'.
  • If your if statement evaluates to True, print the 'INCIDENT_DATE', 'AIRPORT', ' ATYPE', and 'DAMAGE'.