Beispiel #1
0
    def test_gapply_python_only_udt_val(self):
        def pandasAggFunction(series):
            x = float(series.apply(lambda pt: int(pt.x) + int(pt.y)).sum())
            return PythonOnlyPoint(
                x, x)  # still deterministic, can have exact equivalence test

        dataType = PythonOnlyUDT()
        dataGen = lambda: PythonOnlyPoint(
            float(random.randrange(GapplyTests.NVALS)),
            float(random.randrange(GapplyTests.NVALS)))
        self.checkGapplyEquivalentToPandas(pandasAggFunction, dataType,
                                           dataGen)
Beispiel #2
0
 def pandasAggFunction(series):
     x = float(series.apply(lambda pt: int(pt.x) + int(pt.y)).sum())
     return PythonOnlyPoint(
         x, x)  # still deterministic, can have exact equivalence test
Beispiel #3
0
 def dataGen():
     return PythonOnlyPoint(float(random.randrange(GapplyTests.NVALS)),
                            float(random.randrange(GapplyTests.NVALS)))