Skip to main content

A tool for dividend distribution analysis.

Project description

NumberDividend

A simple Python package to split a list of numbers so that their sum matches a target value.

Installation

pip install numberdividend

Usage

You can use it as a module:

from numberdividend import NumberCore

array = [1, 2, 3, 5, 6]

div = NumberCore.dividend(array, 900, 3)
NumberCore.display(div)

NumberCore.dividend(array, target_sum, limit)

Calculate the dividend distribution of an array.

Value Type Description
array List[float] List of float numbers to be distributed.
target_sum float Target sum for the distribution.
limit int, optional Maximum number of elements to consider from the array.
return List[Tuple[int, float]] List of tuples containing the index and the dividend value

NumberCore.display(array)

Display the dividend distribution using matplotlib.

Value Type Description
array List[float] List of dividend values to be displayed.

CLI Usage

python -m numberdividend C:\User\path\...\input.csv 300 C:\User\path\...\output.csv --limit 30

⚠️ Only .csv files are supported as input. Structure of input.csv:

No column name
1
2
3
5
9

Command struct

Value Type Description
path str Input file path
target int Value of sum the array
save str Output file path
--limit int Optional limit on the number of elements considered

License

MIT

Author

Sabolch - Github profile

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

numberdividend-0.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

numberdividend-0.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file numberdividend-0.1.tar.gz.

File metadata

  • Download URL: numberdividend-0.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for numberdividend-0.1.tar.gz
Algorithm Hash digest
SHA256 4977c67e9576b15b2d7e6194c260d961b666e5b6ec25c7f7c57477f073b8706d
MD5 c3c580020a54d9df5475a378723b3780
BLAKE2b-256 729298d70d8c18b566154668ec9009b6b1551cc45be8a9cf772617634271ca12

See more details on using hashes here.

File details

Details for the file numberdividend-0.1-py3-none-any.whl.

File metadata

  • Download URL: numberdividend-0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for numberdividend-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11a087fd173756f57554352122e29041337c8039758d0b3d0c13927eabaaca16
MD5 c0a773ba40e2d8af9254329d5ff4e8c4
BLAKE2b-256 17c15bec20c1eaf8468e71807d847ac8b197eea127d65bd6a1a25ef2ba5bae4c

See more details on using hashes here.

Supported by

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