Skip to main content

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

Project description

pycvcqv

PyPI Python Version Build status coverage report Downloads "Buy Me A Coffee" static analysis dependencies vulnerabilities maintainability complexity lint report docstring Code style: black Security: bandit Pre-commit License

Find homogeneity with confidence.

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, 5.7, 5.8, 5.9, 6.0, 6.6, 7.1, 7.9
    ],
    multiplier=100,
    ndigits=2
)
# {'cv': 57.77, 'lower': 41.43, 'upper': 98.38}
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      lower      upper
# 0   col-1  0.6076     0.3770     1.6667
# 1   col-2  0.1359     0.0913     0.2651
cqv(data=data, num_threads=-1)
#   columns      cqv
# 0   col-1  0.3889
# 1   col-2  0.0732

Credits

🚀 Your next Python package needs a bleeding-edge project structure. This project was generated with python-package-template

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

pycvcqv-0.3.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

pycvcqv-0.3.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file pycvcqv-0.3.0.tar.gz.

File metadata

  • Download URL: pycvcqv-0.3.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pycvcqv-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3524c3bb2aeed9345e105598ee2963e94c105fbb78dc781fb93e7bc1e8dc5a0d
MD5 887475dd45ae765393be40cb973ec07b
BLAKE2b-256 6f17eb516acf25d7d092cba3a69d98b7e6fd149f374e18ba288e8e13835c8daa

See more details on using hashes here.

File details

Details for the file pycvcqv-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pycvcqv-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pycvcqv-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4715fd4f4606c45e09bf454f42f125c547f622600807475a40e40e49999e1de9
MD5 c16ba671f38b796edf40d57cc4d2094b
BLAKE2b-256 2bc9581e6f4816a2fa76a2ea5eefb3a86a46b22393dbfe259c8c572b3667275d

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