Python - How to fetch the FIRST row of each group using pandas ?

preview_player
Показать описание
Python How to fetch/get the first row of each group using pandas ?

Important Link:

Similar Questions:
- Group by pandas dataframe and select latest in each group
Рекомендации по теме
Комментарии
Автор

Thank you!!! very practical user case!

Tyokok
Автор

I have an excel sheet with their leave record. I want to identify first row of each employ record and perform some function on it. How do i do that

alikhanak
Автор

how to find nth highest salary group wise in dataframe please tell me

Employee={'EMPNO':(111, 112, 114, 115, 223, 226, 228, 300, 333, 345, 356, 320), 'Salary':(4000, 6000, 2000, 8000, 2000, 1000, 3000, 500, 700, 300, 200, 700), 'EMPCODE':('MGF', 'MGR', 'MGR', 'MGR', 'CLERK', 'CLERK', 'CLERK', 'PEON', 'PEON', 'PEON', 'PEON', 'PEON')}
Employee

emp_df

BHARATHEEYUDU.