Skip to main content

Lifetime value function over time.

Project description

lifetime-value

A library to help finding the lifetime value of a group of subjects by calculating the average values through time.

Installation

You can install lifetime-value from PyPI using pip like this:

pip install lifetime-value

Usage

import pandas as pd
import lifetime_value as ltv

df_subjects = pd.DataFrame({
    'subject_id': ['a', 'b', 'c'],
    'lifetime': [6, 6, 4],
})

df_events = pd.DataFrame({
    'subject_id': ['a', 'a', 'b', 'c', 'c', 'a'],
    'time': [3, 1, 5, 1, 4, 3],
    'value': [12.3, 0.5, 1.5, 3.3, 34.3, 1.2]
})

df_result = ltv.lifetime_value(df_subjects, df_events, confidence_level=0.8)
print(df_result)

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

lifetime-value-0.0.2.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

lifetime_value-0.0.2-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page