def tel_deact(serie):
    """
    Counts amount of cars from a serie when there is an activation.
    When the sensor then turns off there is a car added.
    :param serie: slice from sensor column in the dataframe when the traffic light turns green
    :return: amount of cars that went by while traffic light was green
    """
    act = False
    cars = 0
    for row in serie:
        if row == "|" and act == False:
            act = True
        elif row != "|" and act == True:
            act = False
            cars += 1
    return cars