Group By Javascript Array Of Strings In Python Are Immutable