Check with sort_values
+drop_duplicates
df.sort_values('B').drop_duplicates(['A'],keep='last')
Out[127]:
A B C
1 1 1 b
3 2 3 d
More Related Contents:
- Get statistics for each group (such as count, mean, etc) using pandas GroupBy?
- How to access pandas groupby dataframe by key
- Group dataframe and get sum AND count?
- get first and last values in a groupby
- Pandas groupby and aggregation output should include all the original columns (including the ones not aggregated on)
- How to get number of groups in a groupby object in pandas?
- How can I pivot a dataframe?
- How do I Pandas group-by to get sum?
- Aggregation in Pandas
- Groupby value counts on the dataframe pandas
- GroupBy pandas DataFrame and select most common value
- Converting a Pandas GroupBy output from Series to DataFrame
- Pandas GroupBy.apply method duplicates first group
- Python: get a frequency count based on two columns (variables) in pandas dataframe some row appers
- Pandas dataframe get first row of each group
- Pandas groupby multiple fields then diff
- Pandas groupby mean – into a dataframe?
- How to loop over grouped Pandas dataframe?
- group by pandas dataframe and select latest in each group
- How to drop duplicates based on two or more subsets criteria in Pandas data-frame
- Pandas get frequency of item occurrences in a column as percentage [duplicate]
- Python Pandas How to assign groupby operation results back to columns in parent dataframe?
- How can I use cumsum within a group in Pandas?
- why does pandas rolling use single dimension ndarray
- Add a sequential counter column on groups to a pandas dataframe
- pandas divide row value by aggregated sum with a condition set by other cell
- How to summarize on different groupby combinations?
- how to convert monthly data to quarterly in pandas
- Get frequency of item occurrences in a column as percentage [duplicate]
- When is it appropriate to use df.value_counts() vs df.groupby(‘…’).count()?