def expectation(self, expr, var, evaluate=True, **kwargs):
        # TODO: support discrete sets with non integer stepsizes
        if evaluate:
            return summation(expr * self.pdf(var),
                         (var, self.set.inf, self.set.sup), **kwargs)
        else:
            return Sum(expr * self.pdf(var),
                         (var, self.set.inf, self.set.sup), **kwargs)
Joins a DStream (a stream of RDDs) with a Cassandra table
dataset/ETHPy150Open sympy/sympy/sympy/stats/drv.py/SingleDiscreteDistribution.expectation--crossover with--dataset/ETHPy150Open TargetHolding/pyspark-cassandra/python/pyspark_cassandra/streaming.py/joinWithCassandraTable