Map unique string to numbers

I have a range of cities I’m working on, and I can’t perform statistical analysis on strings. How can I convert these strings into unique numerical mappings?