Ejemplo n.º 1
0
def test_series_groupby_agg(agg):
    s = pd.Series([1, 2, 3])
    g = Series([1, 2, 3])
    sg = s.groupby(s // 2).agg(agg)
    gg = g.groupby(g // 2).agg(agg)
    check_dtype = False if agg == "count" else True
    assert_eq(sg, gg, check_dtype=check_dtype)
Ejemplo n.º 2
0
def test_series_groupby_agg(agg):
    s = pd.Series([1, 2, 3])
    g = Series([1, 2, 3])
    sg = s.groupby(s // 2).agg(agg)
    gg = g.groupby(g // 2).agg(agg)
    check_dtype = False if agg in _index_type_aggs else True
    assert_groupby_results_equal(sg, gg, check_dtype=check_dtype)
Ejemplo n.º 3
0
def test_series_groupby(agg):
    s = pd.Series([1, 2, 3])
    g = Series([1, 2, 3])
    sg = s.groupby(s // 2)
    gg = g.groupby(g // 2)
    sa = getattr(sg, agg)()
    ga = getattr(gg, agg)()
    check_dtype = False if agg == "count" else True
    assert_eq(sa, ga, check_dtype=check_dtype)
Ejemplo n.º 4
0
def test_series_groupby(agg):
    s = pd.Series([1, 2, 3])
    g = Series([1, 2, 3])
    sg = s.groupby(s // 2)
    gg = g.groupby(g // 2)
    sa = getattr(sg, agg)()
    ga = getattr(gg, agg)()
    check_dtype = False if agg in _index_type_aggs else True
    assert_groupby_results_equal(sa, ga, check_dtype=check_dtype)