Created
December 26, 2023 21:14
-
-
Save psenger/e8bd8f3569710ea46eee6b489a22143e to your computer and use it in GitHub Desktop.
[Remove Duplicates from an Array and keep order] #Array #Python
This file contains 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
## One liner to remove Duplicates from an array and keep order. | |
old = ['a', 'b', 'a', 'c', 'b', 'a'] | |
new = list(dict.fromkeys(old).keys()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment