cx_economics
cx_economics is a Python library designed to analyze the economics of customer experience (CX) using Net Promoter Score (NPS) and revenue data. It supports both B2C and B2B scenarios, providing insights into CX transitions and their financial implications.
Features
- Generate synthetic customer or account data with pre- and post-NPS scores and revenue.
- Compute Net Promoter Score (NPS) for pre- and post-periods.
- Calculate revenue metrics (average, median) for pre- and post-periods.
- Analyze customer transitions across NPS categories (Promoter, Passive, Detractor).
- Support for B2C and B2B survey types with appropriate data aggregation.
Installation
You can install cx_economics via pip:
pip install cx_economics
Quick Start
1. Import and Initialize the Library
from cx_economics import CXEconomics
# Initialize the CXEconomics class with a seed for reproducibility
cx = CXEconomics(seed=42)
2. Generate Sample Data
# Generate 1000 customer records for a B2C scenario
data = cx.generate_sample_data(num_customers=1000, b2b=False)
print("Sample Data:")
print(data.head())
3. Analyze CX Economics
# Analyze CX economics for a B2C survey
stats = cx.analyze_cx_economics(survey_type='B2C')
print("Analysis Statistics:")
print(stats)
4. Calculate Transition Statistics
# Calculate transition statistics
transitions = cx.get_transition_stats()
print("CX Transitions (DataFrame):")
print(transitions)
Use Cases
- Identify CX Trends: Compare pre- and post-NPS scores to track improvements or declines in customer satisfaction.
- Revenue Impact Analysis: Understand the financial implications of changes in customer loyalty.
- Transition Analysis: Gain insights into how customers move between loyalty categories and their associated revenue impact.
- Support for B2B Scenarios: Aggregate data at the account level for business-to-business CX analysis.
License
This library is licensed under the MIT License.
Metadata
Release files for cx-economics 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cx_economics-1.0.0.tar.gz | 5.2 kB | Without provenance | Details for cx_economics-1.0.0.tar.gz |
Release files / cx_economics-1.0.0.tar.gz
| Download URL | cx_economics-1.0.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7cab998a2942fec53c470cf3f1f078a60e250a140ecfb62bf819db21bc7a13aa
|
|
BLAKE2b-256 checksum How to use checksums |
a69e2253ef4c82e06cd7a8e76ea2a81fdceadbd5b12bd78e5a1932bf402d7b2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|
Security for cx-economics 1.0.0
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.