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)
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
def dataGen(): return PythonOnlyPoint(float(random.randrange(GapplyTests.NVALS)), float(random.randrange(GapplyTests.NVALS)))