Untitled

mail@pastecode.io avatar
unknown
python
a year ago
371 B
1
Indexable
Never
def calc_meanUsers(events: dict, jornada_laboral: int) -> float:
    '''
    Calcula el número medio de usuarios en la cola en una jornada diaria.
    '''
    time_increments: np.array = np.diff(events['hour'])
    out_mean: np.array = np.sum(np.multiply(
        events['nUsers'][:-1],
        time_increments)
        ) / jornada_laboral

    return out_mean