Powershell Group By Count Python String Manipulation