Skip to main content

Groups lists by common intersections

Project description

Groups lists by common intersections

pip install intersection-grouper
from intersection_grouper import group_lists_with_intersections



listgroup = [

    [5, 3, 4, 5],

    [5, 11, 12, 3],

    [52, 34],

    [34, 111, 112],

    [1000, 300],

    [300, 5000],

]



x = group_lists_with_intersections(listgroup, keep_duplicates=True)

print(x)

[(34, 34, 52, 111, 112), (300, 300, 1000, 5000), (3, 3, 4, 5, 5, 5, 11, 12)]



x2 = group_lists_with_intersections(listgroup, keep_duplicates=False)

print(x2)

[(34, 52, 111, 112), (300, 1000, 5000), (3, 4, 5, 11, 12)]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

intersection_grouper-0.11.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

intersection_grouper-0.11-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file intersection_grouper-0.11.tar.gz.

File metadata

  • Download URL: intersection_grouper-0.11.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for intersection_grouper-0.11.tar.gz
Algorithm Hash digest
SHA256 a8eb76770ef50f9129e740e6b93df5d3f6dbfbff67e69a1e54389b33be54748e
MD5 ab6fae829cbd9fa59839d69b2c35d82b
BLAKE2b-256 b822b536d2f982d52c0e46fd2f8642034e41b94f31006c337fd14c1ba83ac400

See more details on using hashes here.

File details

Details for the file intersection_grouper-0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for intersection_grouper-0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 dd40a217babc2e97ec06920d29416602d66e85bc6cbf43c26a7ee9983b404c7b
MD5 9780003743a0f31b2431dc21f84bd11d
BLAKE2b-256 d1bd9ae8f756dbf90356a23685febffe71f5b14495fa9bdca2a1cdeaaeeaf639

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page