Ravindra BagaleCourses & study guides मराठी Track your progress

25. How to Rank and Running Totals in pandas (rank, cumsum, window)

Chala mitrano, groupby ne city totals dile — pan manager vicharto “Pune madhe konta order top?”, “Diwali week cha running GMV?”. Aaj rank, cumsum, ani thoda window (rolling / expanding). Model nahi. Copy-paste lab aahe.

What you will learn in this chapter

  • Why ranks and running totals beat a raw sorted dump
  • rank methods (average, dense, min) in plain English
  • cumsum for day-by-day and city running GMV
  • Group-wise rank and cumsum (.groupby(...).rank / .cumsum)
  • Light windows: rolling and expanding means
  • Common mistakes: unsorted dates, wrong group keys
  • A Blinkit Maharashtra practice lab

Fictional data

Blinkit / Amazon Now figures in this chapter are fictional sample data for learning only. They do not show real company numbers. People names are for practice; e-mails use example.com.

Concepts in this chapter

  1. 25.1Why Rank and Running Totals
  2. 25.2rank: Place Among Peers
  3. 25.3cumsum: Running Totals
  4. 25.4Group-wise Rank and Cumsum
  5. 25.5Light Windows: rolling and expanding
  6. 25.6Common Mistakes
  7. 25.7Practice, Tip and Close

The chapter recap is at the end of the last concept page.