Skip to content
Bird_building_collisions
  • AI Chat
  • Code
  • Report
  • Spinner

    Analysis of bird-building collisions in Chicago with respect to night time lighting over 16 years (2000- 2016)

    Data used

    Chicago collision data: Chicago_collision_data.csv contains records of collisions from McCormick Place (MP) and the rest of Chicago (CHI) used in the analyses in this paper. McCormick Place light scores: light_levels_dryad.csv which contains the light level data for MP (McCormack Place). This data indicates the status of night-time lighting at McCormick Place during pre-dawn walks to collect collisions by recording the proportion of the 17 window bays that were illuminated. Each entry in the Chicago_collision_data.csv is a record of a bird collision with a building.

    Reference: Nocturnal flight-calling behaviour predicts vulnerability to artificial light in migratory birds Benjamin M. Winger, Brian C. Weeks, Andrew Farnsworth, Andrew W. Jones, Mary Hennen and David E. Willard Published:03 April 2019https://doi.org/10.1098/rspb.2019.0364

    Aims of this analysis:

    1) Import the CSVs for the Chicago bird-building collision data and the light level data for McCormack Place. Get a feel for the data and check for missing values.

    2) Find out statistics about the bird-building collisions in with respect to the years and perform linear regression on number of collisions VS the year

    3) Compare the number of collisions with respect to the locality (MP or CH)

    4) Find out how the collision count vary with the light levels in McCormack Place (MP)

    5) Analyse and visualize the relationship between the year, number of collisions and lightscores in McCormack Place

    # Importing the required packages for the data analysis
    import numpy as np
    import pandas as pd
    import matplotlib.pyplot as plt
    import seaborn as sns
    from scipy.stats import linregress

    Aim 1) Import the CSVs for the Chicago bird-building collision data and the light level data for McCormack Place. Get a feel for the data and check for missing values.

    1) a) Exploring the columns and data type information in the chicago_collisions dataframe, and getting the first 5 rows.

    # Making dataframe from the Chicago collision CSV
    chicago_collisions = pd.read_csv("Chicago_collision_data.csv")
    print(chicago_collisions.info())
    print(chicago_collisions.head())
    

    There are 69784 records in total and no missing values in any of the columns. Each row contains data about the genus and species of the bird, the date of the collision and the locality where it happened.

    1) b) Exploring the column data types and rows in the light_levels_mp dataframe and getting the first 5 rows.

    # Making dataframe of using light_levels_dryad.csv which contains the light level data for MP (McCormack Place)
    light_levels_mp = pd.read_csv("Light_levels_dryad.csv")
    print(light_levels_mp.info())
    print(light_levels_mp.head())
    #print(light_levels_mp["Light_Score"].mean())

    There are 3067 entries and no missing values in any of the columns. Each row contains the light scores recorded for McCormack Place and the date on which it was recorded.

    #Adding year column to the dataframe
    chicago_collisions["year"] = pd.DatetimeIndex(chicago_collisions['Date']).year
    print(chicago_collisions.head())

    Aim 2) Find out statistics about the bird-building collisions in with respect to the years and perform linear regression on number of collisions VS the year

    2) a) Find out statistics about the bird-building collisions with respect to the years

    # Creating a Series of number of collisions each year
    ch_collisions_by_yr = chicago_collisions["year"].value_counts(sort = True)
    ch_collisions_by_yr.sort_index(ascending=True).plot.bar()
    plt.xlabel('Year')
    plt.ylabel('Number of collisions')
    plt.show()