Question
1.
2.
3.
4.
Answer (Detailed Solution Below)
Option 4 : Total sales and maximum profit for each city / प्रत्येक शहर की कुल बिक्री और अधिकतम लाभ
Advertisement
Detailed Solution
सही उत्तर Total sales and maximum profit for each city / प्रत्येक शहर की कुल बिक्री और अधिकतम लाभ है।
Key Points
Helpful?
Question:
What does df.groupby('city').agg({'sales': 'sum', 'profit': 'max'}) compute? / df.groupby('city').agg({'sales': 'sum', 'profit': 'max'}) क्या परिकलित करता है?
1.
The total of sales and profit for the whole DataFrame / पूरे DataFrame की बिक्री और लाभ का योग
2.
The number of rows in each city / प्रत्येक शहर में पंक्तियों की संख्या
3.
The average sales and average profit per city / प्रति शहर औसत बिक्री और औसत लाभ
4.
Total sales and maximum profit for each city / प्रत्येक शहर की कुल बिक्री और अधिकतम लाभ
Correct Answer: Total sales and maximum profit for each city / प्रत्येक शहर की कुल बिक्री और अधिकतम लाभ
agg() applies a different aggregation to each named column within every group, so each city gets its total sales and its maximum profit. / agg() प्रत्येक समूह में हर नामित कॉलम पर अलग-अलग संकलन लगाता है, अतः प्रत्येक शहर की कुल बिक्री और अधिकतम लाभ मिलता है।
Downloaded from PrepSnap (prepsnap.in)