Skip to main content

Algorithm of etc.

Project description

pyalgo-tools

pyalgo-tools is a collection of various algorithms.

Example ドント方式で議席数を計算

print(dhondt(100, [45, 12, 34]))
[50 13 37]

Example 指定した合計となる部分集合の列挙

ary = [2, 1, 4, 3, 2]
for subset in enum_sub(ary, 4):
    print(f"sum({subset}) = {sum(subset)}")
sum([2, 2]) = 4
sum([1, 3]) = 4
sum([4]) = 4

Example 2つの円の重なる面積

print(round(circle_overlap_area(0, 2, 1, 0, 1, 2), 4))
3.1416

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pyalgo_tools-0.1.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file pyalgo_tools-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pyalgo_tools-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 405ad971808c6c97dd47f9381e7f4ba896cb6cccae272f01e89b954a31034a30
MD5 67f5581d7fef0e0478aed85b7497dd41
BLAKE2b-256 14258ea9c81ea64c9e7e37c98daaf4d3f4270e822e964e7a0cbc8b110db34356

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