def calculate_density(x):
    """
    This function calculates the density of the number of accidents by the area of the SA2 area
    :param x: geopandas geodataframe
    :return: float density value
    """
    return x['NUM_ACCIDENTS'] / x['AREASQKM16']