Skip to main content

Each item of a list against all others

Project description

Each item of a list against all others

$pip install all-against-all
from all_against_all import all_against_all
import operator

list_ = [1, 2, 3, 4]


e = all_against_all(
    func=operator.add, iterable=list_, ignore_exceptions=True, skip_own=True
)
e = list(e)
for ee in e:
    print(ee)


# [((1, 2), 3), ((1, 3), 4), ((1, 4), 5)]
# [((2, 1), 3), ((2, 3), 5), ((2, 4), 6)]
# [((3, 1), 4), ((3, 2), 5), ((3, 4), 7)]
# [((4, 1), 5), ((4, 2), 6), ((4, 3), 7)]


e = all_against_all(
    func=operator.add, iterable=list_, ignore_exceptions=True, skip_own=False
)
e = list(e)
for ee in e:
    print(ee)


# [((1, 2), 3), ((1, 3), 4), ((1, 4), 5)]
# [((2, 1), 3), ((2, 3), 5), ((2, 4), 6)]
# [((3, 1), 4), ((3, 2), 5), ((3, 4), 7)]
# [((4, 1), 5), ((4, 2), 6), ((4, 3), 7)]
# [((1, 1), 2), ((1, 2), 3), ((1, 3), 4), ((1, 4), 5)]
# [((2, 1), 3), ((2, 2), 4), ((2, 3), 5), ((2, 4), 6)]
# [((3, 1), 4), ((3, 2), 5), ((3, 3), 6), ((3, 4), 7)]
# [((4, 1), 5), ((4, 2), 6), ((4, 3), 7), ((4, 4), 8)]

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

all_against_all-0.10.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

all_against_all-0.10-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file all_against_all-0.10.tar.gz.

File metadata

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

File hashes

Hashes for all_against_all-0.10.tar.gz
Algorithm Hash digest
SHA256 0a21fb2517923a59f65e899d851342e908af3125b944f668e7a9b9e65ced29fb
MD5 4c680d2d2706ceeb1b93951e24ed8cb6
BLAKE2b-256 454f5482b3b8ac1d2a8ca47afc2b58d0b93b7dc60bb1b6ed9e42774524ce0086

See more details on using hashes here.

File details

Details for the file all_against_all-0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for all_against_all-0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 4ee482b0f1c69d2caf6597d370cc3ef07b78c4fcb2a243938bc9ab03f9589168
MD5 fbee55aef9cb24d677c51fda3fb854bc
BLAKE2b-256 379fa63042944d1d757086ab2bab4f7031d3618db980416be8d35a22e4b9ad59

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