Over last weekend, I was working on a data science problem. In the data set, CITY was one of the variable and there is 2000 unique cities across the globe. When I looked at the frequency distribution of these cities, there is almost 1800 cities with a less than 10 entries . Now I want to create a new variable, where I want to group all 1800 cities to a new category “other” with rest of cities. Can you please help me with the code to perform it.