The @Jeff solution provides simple work for series.
@Rafa is located at: df.describe().info() shows that the resulting framework has Index: 8 entries, count to max
df.describe().loc[['count','max']] works, but df.groupby('simpleDate').describe().loc[['count','max']] , which sets OP , does not work.
I think the solution could be as follows:
df = pd.DataFrame({'Y': ['A', 'B', 'B', 'A', 'B'], 'Z': [10, 5, 6, 11, 12], })
grouping df on Y :
df_grouped=df.groupby(by='Y') In [207]df_grouped.agg([np.mean, len]) Out[207]: Z mean len YA 10.500 2 B 7.667 3
source share