rxpy operators the output from the rx operators sum(operator is the total of the data items published by the observable (in this case the total of and the observer function that is subscribed to the rx operators sum(operators observable will print out this valuehoweverin some cases it may be useful to be notified of the intermediate running total as well as the final value so that other operators down the chain can react to these subtotals this can be achieved using the rx operators scan(operator the rx operators scan(operator is actually transformational operator but can be used in this case to provide mathematical operation the scan(operator applies function to each data item published by an observable and generates its own data item for each value received each generated value is passed to the next invocation of the scan(function as well as being published to the scan(operators observable data stream the running total can thus be generated from the previous sub total and the new value obtained this is shown belowimport rx from rx import operators as op rolling or incremental sum rx from_([ ]pipeop scan(lambda subtotalisubtotal+isubscribe(lambda vprint( )the output from this example is this means that each subtotal is published as well as the final total chaining operators an interesting aspect of the rxpy approach to data stream processing is that it is possible to apply multiple operators to the data stream produced by an observable the operators discussed earlier actually return another observable this new observable can supply its own data stream based on the original data stream and the result of applying the operator this allows another operator to be applied in sequence to the data produced by the new observable this allows the operators to be chained together to provide sophisticated processing of the data published by the original observable