Skip to main content

ABC classification library

ABC classification is an inventory categorisation technique. A typical example of ABC classification is the segmentation of products (entity) based on sales (value). The best-selling products that contribute to up to 70% of the total sales belong to cluster A. The products making up the next 20% of sales are in cluster B, whereas the products representing the last 10% of sales, belong to class C. Hence, the pattern is named after the three clusters (ABC).

Example

Installation

pip install abc-classification

Import

from abc_classification.abc_classifier import ABCClassifier

Let's say we have dataframe

product total sold
fade cream 27000
powders 24000
shadows 18000
mascara 16000
lipstick 6000
concealer 5000
sculptors 4000

You can create ABCClasifier object, pass your dataframe to it and call classify method.

abc_clf = ABCClassifier(df)
abc_df = abc_clf.classify('product', 'total sold')

This way you'll get new dataframe with classified products.

product total sold class
fade cream 27000 A
powders 24000 A
shadows 18000 A
mascara 16000 B
lipstick 6000 B
concealer 5000 C
sculptors 4000 C

You also can use brief_abc method to get aggregated information

abc_clf.brief_abc(abc_df)
class total sold
A 69000
B 16000
C 15000

You can plot pareto chart.

from abc_classification.abc_visualiser import pareto_chart


pareto_chart(abc_df, 'total_sold', 'product')

Pareto chart

Metadata

Release files for abc-classification 0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for abc-classification 0.8
File Size Uploaded Provenance
abc_classification-0.8.tar.gz 3.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for abc-classification 0.8
File Interpreter ABI Platform
abc_classification-0.8-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 kB

Release files / abc_classification-0.8.tar.gz

Download URL abc_classification-0.8.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2d3f2ae9163db14bf527012d2984877cd13fdfcd1227e25462a637994a18be80
BLAKE2b-256 checksum
How to use checksums
12ce10853af5c4a8230560a89bd80075f21d778232342f6fbc2ed08ab196d96e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.8.3 requests/2.28.1 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.8.1

Release files / abc_classification-0.8-py3-none-any.whl

Download URL abc_classification-0.8-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93d645c65c3640b59c8cc48cbaaa28c3807216eb9e4323a4722faf92cef27175
BLAKE2b-256 checksum
How to use checksums
f8e293384c8278385157af899949a6ecb8750157626d508e7c5c6bf7fa53d000
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.8.3 requests/2.28.1 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.8.1

Security for abc-classification 0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page