Last active
August 29, 2015 14:06
-
-
Save michaelrice/666561fc9286bbfda8af 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
| # list_one always has fewer list items than list 2 | |
| # both lists have several thousand items in them | |
| list_one = [ | |
| {"acct": "12345a","moref":"dc-12"}, | |
| {"acct":"132132","moref":"dc-332"} | |
| ] | |
| list_two = [ | |
| {"acct":"132132","cc":"US","zip":"77722"}, | |
| {"acct": "12345a", "zip":"55512","cc":"US"}, | |
| {"acct":"11132132","cc":"US","zip":"77722"} | |
| ] | |
| # Looking for most efficient way to combine list_one[0] with list_two[1] | |
| # where the acct matches so I end up with a dict like {"acct": "12345a","moref":"dc-12", "zip":"55512","cc":"US"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment