In [1]: import pandas as pd
In [2]: df = pd.DataFrame({"A": range(5), "B": range(5)})
In [3]: df.groupby(["A"]).mean(["B"])
     B
A     
0  0.0
1  1.0
2  2.0
3  3.0
4  4.0["B"] is being passed to numeric_only which appears checked only to be truthy/falsy.
I would expect this to raise a ValueError