Specify the correct shape in the groupby dtype