Skip to content

Instantly share code, notes, and snippets.

@ritvikmath
Last active April 9, 2019 13:35
Show Gist options
  • Select an option

  • Save ritvikmath/d520036e8debfed6be3c1be8b6a61fad to your computer and use it in GitHub Desktop.

Select an option

Save ritvikmath/d520036e8debfed6be3c1be8b6a61fad to your computer and use it in GitHub Desktop.
remove duplicate stores from allStores
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