You have an orders DataFrame and the city lead wants total revenue per city, biggest first.
Write a function revenue_by_city(df) that returns a Series indexed by city holding the summed amount, sorted from highest to lowest revenue.
More Pandas — GroupBy questions
Practising alone only goes so far — our live cohorts pair Python and Pandas depth with dashboards, agentic analytics projects and mock interviews.
Explore the program