Skip to content

Summary of the answers gathered on SO about list merging based on intersection.

Notifications You must be signed in to change notification settings

thomas-mckay/IntersectionMerge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

===================================
List merging based on intersections
===================================

Summary of the answers from:

Python: simple list merging based on intersections
http://stackoverflow.com/q/9110837/1132524

Python merge multiple list with intersection [closed]
http://stackoverflow.com/q/9353802/1132524


=======
Credits
=======

All the credits to everyone from the links above.


=====
Usage
=====

Add a new function
------------------

All the merge functions are in core.py.

 - place the code in core.py
 - the name must end with '_merge'
 - and it needs a docstring like the others.

After that it will be auto loaded and everything will be taken care of on its own.

Profile a function/list combo
-----------------------------

$ python3 profiler.py -f alexis -l timing_1

This will open a snakeviz visualisation of the execution profile in your browser at the end.

Test all the functions
----------------------

$ python3 test.py

lists/test_list.txt is just random, I didn't give it much thought.

Time all the functions
----------------------

$ python3 timing.py

- Ctrl-C to skip a test.
- Two fast Ctrl-C to exit.

About

Summary of the answers gathered on SO about list merging based on intersection.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%