Last active
April 9, 2019 13:35
-
-
Save ritvikmath/d520036e8debfed6be3c1be8b6a61fad to your computer and use it in GitHub Desktop.
remove duplicate stores from allStores
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
| seenStoreIds = [] | |
| laStores = [] | |
| for store in allStores: | |
| #if we've already seen this store id, then keep going | |
| if store[0] in seenStoreIds: | |
| continue | |
| #if this is the first time seeing this store id, | |
| #then add it to laStores and add its id to seenStoreIds | |
| else: | |
| laStores.append(store) | |
| seenStoreIds.append(store[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment