Skip to content

Instantly share code, notes, and snippets.

@juanarrivillaga
Created July 17, 2017 17:30
Show Gist options
  • Save juanarrivillaga/5c11ea803407d3eec7b8e4a53fe2f409 to your computer and use it in GitHub Desktop.
Save juanarrivillaga/5c11ea803407d3eec7b8e4a53fe2f409 to your computer and use it in GitHub Desktop.
from itertools import chain
from more_itertools import unique_everseen
# don't materialize into a list!
ci = zip(item_name, instance_id, contract_number, serial_number, item_status, product_group_description, item_end_date5))
co = zip(item_name2, instance_id2, contract_number2, serial_number2, item_status2, product_group_description2, item_end_date6))
# use itertools.chain instead of list-concatenation if you want to chain to iterables!
# You should, *use snake_case*, it's the PEP8 recommended way. If you *do* want to use camelCase
# the don't mix snake_case and camelCase. Use one or the other. Preferablly snake_case :)
all_records = chain(ci, co)
calculation = list(unique_everseen(all_records))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment