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 --display

⚠️ 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
--display none Optional displays the processed array

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.1.tar.gz (4.3 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.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: numberdividend-0.1.1.tar.gz
  • Upload date:
  • Size: 4.3 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.1.tar.gz
Algorithm Hash digest
SHA256 e18b8fbe597692f297d0bcf8545f3cb536709a2a7ff0a3038e06c8dda5eca155
MD5 613dd2e7db021087030d59f6f20d2d9d
BLAKE2b-256 5e42ec7b1aac9fffc91ba90de3a688dbe51dfff433d9ea5d63d81a051e5666ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: numberdividend-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 40306c8b0b4eb78d54906039346c3b25c6f5c962ec0bb473711a80f0b865b1e5
MD5 c187e6bfcae08bfeeb6aafbcce89107b
BLAKE2b-256 f190857c27b1349676ed0407acdf3653958a377f4675bb5da8e2c43384a5be07

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