works with groupby instead of partitioning