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)
Built Distribution
Close
Hashes for lifetime_value-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df3d038fdabed156fd2741a3964b6b9c5a86a47f56e6dd5763568025e189538a |
|
MD5 | f05c6e397833006fde94d9eeeecf0f2f |
|
BLAKE2b-256 | 6841ed0e75daa766114e488f303c983a92ab4c7beb9d107db6908870511fa60d |