Skip to content

Coefficient of Variation (CV) and Coefficient of Quartile Variation (CQV) with Confidence Intervals (CI). Python port of https://github.com/MaaniBeigy/cvcqv)

License

Notifications You must be signed in to change notification settings

hartl3y94/pycvcqv

 
 

Repository files navigation

pycvcqv

PyPI Python Version Build status coverage report static analysis Dependencies Status

maintainability complexity Safety Vulnerabilities docstring coverage lint report

Code style: black Security: bandit Pre-commit Semantic Versions License FOSSA Status

Coefficient of Variation (CV) and Coefficient of Quartile Variation (CQV) with Confidence Intervals (CI)

Python port of cvcqv

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

pip install pycvcqv

Usage

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:

make install
make pre-commit-install
make test && make coverage && make check-codestyle && make mypy && make check-safety && make extrabadges

Upload code to GitHub:

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.

FOSSA Status

This project was generated with python-package-template

License

FOSSA Status

About

Coefficient of Variation (CV) and Coefficient of Quartile Variation (CQV) with Confidence Intervals (CI). Python port of https://github.com/MaaniBeigy/cvcqv)

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 87.6%
  • Shell 5.6%
  • Makefile 5.3%
  • Dockerfile 1.5%