def up(x):
    return (x >= 0).sum()

def down(x):
    return (x < 0).sum()
result = A.loc[:, 'B':'C'].groupby(A['A'] > 2).agg([up, down, 'mean', 'std'])
How to use groupby to apply multiple functions to multiple columns in Pandas?