How many customers are in each city? If you're pulling all the rows into Python and using Counter or pandas groupby(), you're doing too much work.
SQL's GROUP BY does the counting on the database server and sends back just the summary. Five cities? Five rows returned. Not 10,000.
Read more about GROUP BY, aggregate functions (COUNT, SUM, AVG, MIN, MAX), and the golden rule of grouping.
