use groupby for archives