fix same_shapes in average_groups.py