0
Market  Region     No_of_Orders Profit  Sales
Africa  Western Africa  251 -12,901.51  78,476.06
Africa  Southern Africa 85  11,768.58   51,319.50
Africa  North Africa    182 21,643.08   86,698.89
Africa  Eastern Africa  110 8,013.04    44,182.60
Africa  Central Africa  103 15,606.30   61,689.99
Europe  Western Europe  964 82,091.27   656,637.14
Europe  Southern Europe 338 18,911.49   215,703.93
Europe  Northern Europe 367 43,237.44   252,969.09
Europe  Eastern Europe  241 25,050.69   108,258.93

How to calculate the total Profit of Africa with respect to market using pandas?

Kishan
  • 334
  • 2
  • 16

1 Answers1

0

IIUC, for Africa:

df[df.Market=='Africa'].Profit.sum()

If you want the profit for each market, use the solution provided by @XXavier in the comment.

CHRD
  • 1,917
  • 1
  • 15
  • 38