Powershell Group By Count Python Array Slicing