Created
June 16, 2019 11:52
-
-
Save admond1994/b6d43ff2db793d9d091e16a8cc21d40d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_unique_last_str(df): | |
| ''' | |
| AIM -> get unique last str for a column | |
| INPUT -> df | |
| OUTPUT -> updated df based on the unique last strings in a column | |
| ------ | |
| ''' | |
| df = df[df.index.isin(df['col_1'].drop_duplicates(keep='last').index)].reset_index(drop=True) | |
| return df |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment