from itertools import tee copy1, copy2 = tee(noisy_sensor, 2) averages = moving_average(copy1) deviations = moving_deviation(copy2) ...