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, 5)
NumberCore.display(div)
NumberCore.dividend(array, target_sum, limit, decimal)
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. |
| decimal | int, optional | Number of decimal places for the output. |
| return | List[Tuple[float, 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file numberdividend-0.1.2.tar.gz.
File metadata
- Download URL: numberdividend-0.1.2.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d27087cd5c14b6334705f77d77b6e7d684fa1655fbcf980328e0fe4c6cdc06e
|
|
| MD5 |
bce5ca3e2f7d54e075720eeb2e266ba9
|
|
| BLAKE2b-256 |
26b7efd08ea9a14fa1ba44a6fae2769ec86c858cb83b8458154a989db5eb8af1
|
File details
Details for the file numberdividend-0.1.2-py3-none-any.whl.
File metadata
- Download URL: numberdividend-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6251c0d8c1b02f1e5a81ef4099e3175553133939e14f6f81fbb57b17fc7fb4dc
|
|
| MD5 |
574b684186c76b768886fc2eadf0ec48
|
|
| BLAKE2b-256 |
f063985639a59eb658c063e90ee36b5964a1b4a2fdfbd31926410de3b48ebe2a
|