예제 #1
0
def test_summary_mean(pyspark, summarizers, tests_utils, price, forecast):
    expected_pdf = make_pdf([(
        0,
        3.25,
    )], ["time", "price_mean"])
    joined = price.leftJoin(forecast, key="id")
    result = joined.summarize(summarizers.mean("price")).toPandas()
    pdt.assert_frame_equal(result, expected_pdf)
예제 #2
0
 def test_summary_mean(self):
     from ts.flint import summarizers
     price = self.price()
     forecast = self.forecast()
     expected_pdf = test_utils.make_pdf([(
         0,
         3.25,
     )], ["time", "price_mean"])
     joined = price.leftJoin(forecast, key="id")
     result = joined.summarize(summarizers.mean("price")).toPandas()
     pdt.assert_frame_equal(result, expected_pdf)
예제 #3
0
    def test_summary_mean(self):
        from ts.flint import summarizers

        price = self.price()
        forecast = self.forecast()
        expected_pdf = make_pdf([
            (0, 3.25,)
        ], ["time", "price_mean"])

        joined = price.leftJoin(forecast, key="id")
        result = joined.summarize(summarizers.mean("price")).toPandas()
        pdt.assert_frame_equal(result, expected_pdf)
예제 #4
0
    def test_summary_compose(self):
        from ts.flint import summarizers

        price = self.price()

        expected_pdf = make_pdf([
            (0, 6.0, 0.5, 3.25, 1.802775638,)
        ], ["time", "price_max", "price_min", "price_mean", "price_stddev"])

        result = price.summarize([summarizers.max("price"),
                                  summarizers.min("price"),
                                  summarizers.mean("price"),
                                  summarizers.stddev("price")]).toPandas()
        pdt.assert_frame_equal(result, expected_pdf)
예제 #5
0
def test_summary_compose(pyspark, summarizers, tests_utils, price):
    expected_pdf = make_pdf([(
        0,
        6.0,
        0.5,
        3.25,
        1.802775638,
    )], ["time", "price_max", "price_min", "price_mean", "price_stddev"])

    result = price.summarize([
        summarizers.max("price"),
        summarizers.min("price"),
        summarizers.mean("price"),
        summarizers.stddev("price")
    ]).toPandas()
    pdt.assert_frame_equal(result, expected_pdf)
예제 #6
0
 def test_summary_compose(self):
     from ts.flint import summarizers
     price = self.price()
     expected_pdf = test_utils.make_pdf([(
         0,
         6.0,
         0.5,
         3.25,
         1.802775638,
     )], ["time", "price_max", "price_min", "price_mean", "price_stddev"])
     result = price.summarize([
         summarizers.max("price"),
         summarizers.min("price"),
         summarizers.mean("price"),
         summarizers.stddev("price")
     ]).toPandas()
     pdt.assert_frame_equal(result, expected_pdf)