dscigametrics.stat_summary
Module Contents
Functions
|
Return statistics summary of metrics. |
- dscigametrics.stat_summary.stat_summary(data, campaign_id, start_date, end_date)[source]
Return statistics summary of metrics.
- Return a pandas dataframe presenting the statistics summary of the four metric, where the metrics are:
New to return rate
Conversion rate
Total transaction revenue
Average transaction revenue
- Parameters:
data (dataframe) – Dataframe containing information from google analytics.
campaign_id (int) – The unique id of the campaign.
start_date (int) – The campaign start date.
end_date (int) – The campaign end date.
- Returns:
summary_table – A pandas dataframe contains the mean, median and standard deviation of the four metrics of each day. Four metrics:
New to return rate
Conversion rate
Total transaction revenue
Average transaction revenue
- Return type:
pd.DataFrame
Example
>>> summary = stat_summary(data, 11111111, 20170817, 20170820) >>> print(summary) return conversion ttl_revenue avg_revenue Mean 0.01 0.05 250 100 Median 0.02 0.04 238 120 SD 1.43 0.66 1.62 0.77