Ravindra Bagale · Data Scienceसर्व coursesया course चे lessonsशोधाEnglish

Data Science · मराठी आवृत्ती

6.3 Sorting आणि top-N rows

रवींद्र बागले यांच्या course वर आधारित · सहज मराठीत explanation

या page मध्ये

Amount उतरत्या क्रमाने, city आणि amount दोन्हींनुसार, किंवा फक्त वरच्या तीन rows अशा वेगवेगळ्या पद्धती वापरता येतात:

df.sort_values("amount", ascending=False)
df.sort_values(["city", "amount"], ascending=[True, False])
df.nlargest(3, "amount")
df.nsmallest(3, "delivery_mins")

काल्पनिक उदाहरण: Amir delivery_mins ascending sort करून सर्वात fast trips पाहतो. Pune मधल्या Shahrukh ची 8 minutes ची trip सर्वात आधी येते; ही शिकण्यासाठीची नोंद आहे.

Practice

Cancelled आणि Returned rows amount descending क्रमाने दाखवा. मग Delivered rows मधल्या top 3 amounts साठी nlargest वापरा.

Recap

पुढे GroupBy आणि aggregations करूया.