# pycvcqv
<div align="center">
[![PyPI](https://img.shields.io/pypi/v/pycvcqv)](https://pypi.org/project/pycvcqv/)
[![Python Version](https://img.shields.io/pypi/pyversions/pycvcqv.svg)](https://pypi.org/project/pycvcqv/)
[![Build status](https://github.com/MaaniBeigy/pycvcqv/workflows/build/badge.svg)](https://github.com/MaaniBeigy/pycvcqv/actions?query=workflow%3Abuild)
[![coverage report](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/assets/images/coverage.svg)](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/.logs/coverage.txt)
[![static analysis](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/assets/images/mypy.svg)](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/.logs/mypy.txt)
[![Dependencies Status](https://img.shields.io/badge/dependencies-up%20to%20date-brightgreen.svg)](https://github.com/MaaniBeigy/pycvcqv/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aapp%2Fdependabot)
[![maintainability](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/assets/images/maintainability.svg)](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/.logs/maintainability.txt)
[![complexity](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/assets/images/complexity.svg)](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/.logs/complexity.txt)
[![lint report](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/assets/images/pylint.svg)](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/.logs/pylint-log.txt)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Security: bandit](https://img.shields.io/badge/security-bandit-green.svg)](https://github.com/PyCQA/bandit)
[![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/MaaniBeigy/pycvcqv/blob/master/.pre-commit-config.yaml)
[![Semantic Versions](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--versions-e10079.svg)](https://github.com/MaaniBeigy/pycvcqv/releases)
[![License](https://img.shields.io/github/license/MaaniBeigy/pycvcqv)](https://github.com/MaaniBeigy/pycvcqv/blob/master/LICENSE)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FMaaniBeigy%2Fpycvcqv.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FMaaniBeigy%2Fpycvcqv?ref=badge_shield)
Coefficient of Variation (CV) and Coefficient of Quartile Variation (CQV) with Confidence Intervals (CI)
Python port of [cvcqv](https://github.com/MaaniBeigy/cvcqv)
</div>
## Introduction
`pycvcqv` provides some easy-to-use functions to calculate the
Coefficient of Variation (`cv`) and Coefficient of Quartile Variation (`cqv`)
with confidence intervals provided with all available methods.
## Install
```bash
pip install pycvcqv
```
## Usage
```python
import pandas as pd
from pycvcqv import coefficient_of_variation, cqv
coefficient_of_variation(
data=[0.2, 0.5, 1.1, 1.4, 1.8, 2.3, 2.5, 2.7, 3.5, 4.4, 4.6, 5.4, 5.4],
multiplier=100,
)
# 64.6467
cqv(
data=[0.2, 0.5, 1.1, 1.4, 1.8, 2.3, 2.5, 2.7, 3.5, 4.4, 4.6, 5.4, 5.4],
multiplier=100,
)
# 51.7241
data = pd.DataFrame(
{
"col-1": pd.Series([0.2, 0.5, 1.1, 1.4, 1.8, 2.3, 2.5, 2.7, 3.5]),
"col-2": pd.Series([5.4, 5.4, 5.7, 5.8, 5.9, 6.0, 6.6, 7.1, 7.9]),
}
)
coefficient_of_variation(data=data, num_threads=3)
# columns cv
# 0 col-1 0.6076
# 1 col-2 0.1359
cqv(data=data, num_threads=-1)
# columns cqv
# 0 col-1 0.3889
# 1 col-2 0.0732
```
## For contributors:
### Testing:
```bash
export PATH="$HOME/.poetry/bin:$PATH"
make install
make pre-commit-install
make test && make coverage && make check-codestyle && make mypy && make check-safety && make extrabadges
```
### Upload code to GitHub:
```bash
git pull
pre-commit run --all-files
git add .
git commit -m ":tada: Initial commit"
git push -u origin main
```
## Credits [![🚀 Your next Python package needs a bleeding-edge project structure.](https://img.shields.io/badge/python--package--template-%F0%9F%9A%80-brightgreen)](https://github.com/TezRomacH/python-package-template)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FMaaniBeigy%2Fpycvcqv.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FMaaniBeigy%2Fpycvcqv?ref=badge_shield)
This project was generated with [`python-package-template`](https://github.com/TezRomacH/python-package-template)
## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FMaaniBeigy%2Fpycvcqv.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FMaaniBeigy%2Fpycvcqv?ref=badge_large)
Raw data
{
"_id": null,
"home_page": "https://github.com/MaaniBeigy/pycvcqv",
"name": "pycvcqv",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8.1,<4.0",
"maintainer_email": "",
"keywords": "coefficient of variation,coefficient of quartile variation,data science",
"author": "MaaniBeigy",
"author_email": "manibeygi@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ce/e8/c3fd355763068f7551b8e2de794673985057de5a1294dfef62effac6a607/pycvcqv-0.1.12.tar.gz",
"platform": null,
"description": "# pycvcqv\n\n<div align=\"center\">\n\n[![PyPI](https://img.shields.io/pypi/v/pycvcqv)](https://pypi.org/project/pycvcqv/)\n[![Python Version](https://img.shields.io/pypi/pyversions/pycvcqv.svg)](https://pypi.org/project/pycvcqv/)\n[![Build status](https://github.com/MaaniBeigy/pycvcqv/workflows/build/badge.svg)](https://github.com/MaaniBeigy/pycvcqv/actions?query=workflow%3Abuild)\n[![coverage report](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/assets/images/coverage.svg)](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/.logs/coverage.txt)\n[![static analysis](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/assets/images/mypy.svg)](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/.logs/mypy.txt)\n[![Dependencies Status](https://img.shields.io/badge/dependencies-up%20to%20date-brightgreen.svg)](https://github.com/MaaniBeigy/pycvcqv/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aapp%2Fdependabot)\n\n[![maintainability](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/assets/images/maintainability.svg)](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/.logs/maintainability.txt)\n[![complexity](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/assets/images/complexity.svg)](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/.logs/complexity.txt)\n[![lint report](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/assets/images/pylint.svg)](https://raw.githubusercontent.com/MaaniBeigy/pycvcqv/main/.logs/pylint-log.txt)\n\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Security: bandit](https://img.shields.io/badge/security-bandit-green.svg)](https://github.com/PyCQA/bandit)\n[![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/MaaniBeigy/pycvcqv/blob/master/.pre-commit-config.yaml)\n[![Semantic Versions](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--versions-e10079.svg)](https://github.com/MaaniBeigy/pycvcqv/releases)\n[![License](https://img.shields.io/github/license/MaaniBeigy/pycvcqv)](https://github.com/MaaniBeigy/pycvcqv/blob/master/LICENSE)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FMaaniBeigy%2Fpycvcqv.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FMaaniBeigy%2Fpycvcqv?ref=badge_shield)\n\nCoefficient of Variation (CV) and Coefficient of Quartile Variation (CQV) with Confidence Intervals (CI)\n\nPython port of [cvcqv](https://github.com/MaaniBeigy/cvcqv)\n\n</div>\n\n## Introduction\n\n`pycvcqv` provides some easy-to-use functions to calculate the\nCoefficient of Variation (`cv`) and Coefficient of Quartile Variation (`cqv`)\nwith confidence intervals provided with all available methods.\n\n## Install\n\n```bash\npip install pycvcqv\n```\n\n## Usage\n\n```python\nimport pandas as pd\nfrom pycvcqv import coefficient_of_variation, cqv\n\ncoefficient_of_variation(\n data=[0.2, 0.5, 1.1, 1.4, 1.8, 2.3, 2.5, 2.7, 3.5, 4.4, 4.6, 5.4, 5.4],\n multiplier=100,\n)\n# 64.6467\ncqv(\n data=[0.2, 0.5, 1.1, 1.4, 1.8, 2.3, 2.5, 2.7, 3.5, 4.4, 4.6, 5.4, 5.4],\n multiplier=100,\n)\n# 51.7241\ndata = pd.DataFrame(\n {\n \"col-1\": pd.Series([0.2, 0.5, 1.1, 1.4, 1.8, 2.3, 2.5, 2.7, 3.5]),\n \"col-2\": pd.Series([5.4, 5.4, 5.7, 5.8, 5.9, 6.0, 6.6, 7.1, 7.9]),\n }\n)\ncoefficient_of_variation(data=data, num_threads=3)\n# columns cv\n# 0 col-1 0.6076\n# 1 col-2 0.1359\ncqv(data=data, num_threads=-1)\n# columns cqv\n# 0 col-1 0.3889\n# 1 col-2 0.0732\n```\n\n## For contributors:\n\n### Testing:\n\n```bash\nexport PATH=\"$HOME/.poetry/bin:$PATH\"\nmake install\nmake pre-commit-install\nmake test && make coverage && make check-codestyle && make mypy && make check-safety && make extrabadges\n```\n\n### Upload code to GitHub:\n\n```bash\ngit pull\npre-commit run --all-files\ngit add .\ngit commit -m \":tada: Initial commit\"\ngit push -u origin main\n```\n\n\n## Credits [![\ud83d\ude80 Your next Python package needs a bleeding-edge project structure.](https://img.shields.io/badge/python--package--template-%F0%9F%9A%80-brightgreen)](https://github.com/TezRomacH/python-package-template)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FMaaniBeigy%2Fpycvcqv.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FMaaniBeigy%2Fpycvcqv?ref=badge_shield)\n\nThis project was generated with [`python-package-template`](https://github.com/TezRomacH/python-package-template)\n\n\n## License\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FMaaniBeigy%2Fpycvcqv.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FMaaniBeigy%2Fpycvcqv?ref=badge_large)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Coefficient of Variation (CV) and Coefficient of Quartile Variation (CQV) with Confidence Intervals (CI) ",
"version": "0.1.12",
"project_urls": {
"Homepage": "https://github.com/MaaniBeigy/pycvcqv",
"Repository": "https://github.com/MaaniBeigy/pycvcqv"
},
"split_keywords": [
"coefficient of variation",
"coefficient of quartile variation",
"data science"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "209fadce04380068402a771cd002eae6b637ba2861aca970d2057c63bb402d0d",
"md5": "b38c8b33dfcb4955317c5736538d90e8",
"sha256": "34ee70cc8294f41bb663754ecbf6d4f00f389a1e2b89dd6e3435c19a8c5e42cf"
},
"downloads": -1,
"filename": "pycvcqv-0.1.12-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b38c8b33dfcb4955317c5736538d90e8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.1,<4.0",
"size": 12132,
"upload_time": "2023-09-23T13:21:22",
"upload_time_iso_8601": "2023-09-23T13:21:22.502911Z",
"url": "https://files.pythonhosted.org/packages/20/9f/adce04380068402a771cd002eae6b637ba2861aca970d2057c63bb402d0d/pycvcqv-0.1.12-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cee8c3fd355763068f7551b8e2de794673985057de5a1294dfef62effac6a607",
"md5": "6ff967e1c6ffe2dc7a2a709f870952ac",
"sha256": "e30d29fd2ff2507506a719d52fe5df8217400ed5b2abe696766e774118b964d8"
},
"downloads": -1,
"filename": "pycvcqv-0.1.12.tar.gz",
"has_sig": false,
"md5_digest": "6ff967e1c6ffe2dc7a2a709f870952ac",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.1,<4.0",
"size": 9961,
"upload_time": "2023-09-23T13:21:25",
"upload_time_iso_8601": "2023-09-23T13:21:25.023371Z",
"url": "https://files.pythonhosted.org/packages/ce/e8/c3fd355763068f7551b8e2de794673985057de5a1294dfef62effac6a607/pycvcqv-0.1.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-23 13:21:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "MaaniBeigy",
"github_project": "pycvcqv",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"lcname": "pycvcqv"
}