-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"session_end": {"data": {"series": [{"values": {"Oct 16": [{"count": 28, "outof": 28, "incomplete": true}, {"count": 28, "outof": 28, "incomplete": true}], "Oct 09": [{"count": 218, "outof": 218, "incomplete": false}, {"count": 218, "outof": 218, "incomplete": true}, {"count": 6, "outof": 218, "incomplete": true}], "Oct 02": [{"count": 109, "outof": 109, "incomplete": false}, {"count": 109, "outof": 109, "incomplete": false}, {"count": 53, "outof": 109, "incomplete": true}, {"count": 12, "outof": 109, "incomplete": true}], "Sep 25": [{"count": 111, "outof": 111, "incomplete": false}, {"count": 111, "outof": 111, "incomplete": false}, {"count": 43, "outof": 111, "incomplete": false}, {"count": 38, "outof": 111, "incomplete": true}, {"count": 7, "outof": 111, "incomplete": true}], "Sep 18": [{"count": 126, "outof": 126, "incomplete": false}, {"count": 126, "outof": 126, "incomplete": false}, {"count": 52, "outof": 126, "incomplete": false}, {"count": 46, "outof": 126, "incomplete": false}, {"count": 28, "outof": 126, "incomplete": true}, {"count": 2, "outof": 126, "incomplete": true}], "Sep 11": [{"count": 117, "outof": 117, "incomplete": false}, {"count": 117, "outof": 117, "incomplete": false}, {"count": 41, "outof": 117, "incomplete": false}, {"count": 34, "outof": 117, "incomplete": false}, {"count": 37, "outof": 117, "incomplete": false}, {"count": 23, "outof": 117, "incomplete": true}, {"count": 4, "outof": 117, "incomplete": true}], "Sep 04": [{"count": 152, "outof": 152, "incomplete": false}, {"count": 152, "outof": 152, "incomplete": false}, {"count": 56, "outof": 152, "incomplete": false}, {"count": 48, "outof": 152, "incomplete": false}, {"count": 43, "outof": 152, "incomplete": false}, {"count": 37, "outof": 152, "incomplete": false}, {"count": 24, "outof": 152, "incomplete": true}, {"count": 2, "outof": 152, "incomplete": true}], "Aug 28": [{"count": 122, "outof": 122, "incomplete": false}, {"count": 122, "outof": 122, "incomplete": false}, {"count": 41, "outof": 122, "incomplete": false}, {"count": 38, "outof": 122, "incomplete": false}, {"count": 26, "outof": 122, "incomplete": false}, {"count": 22, "outof": 122, "incomplete": false}, {"count": 22, "outof": 122, "incomplete": false}, {"count": 15, "outof": 122, "incomplete": true}, {"count": 1, "outof": 122, "incomplete": true}], "Aug 21": [{"count": 141, "outof": 141, "incomplete": false}, {"count": 141, "outof": 141, "incomplete": false}, {"count": 48, "outof": 141, "incomplete": false}, {"count": 42, "outof": 141, "incomplete": false}, {"count": 40, "outof": 141, "incomplete": false}, {"count": 37, "outof": 141, "incomplete": false}, {"count": 27, "outof": 141, "incomplete": false}, {"count": 25, "outof": 141, "incomplete": false}, {"count": 18, "outof": 141, "incomplete": true}, {"count": 2, "outof": 141, "incomplete": true}], "Aug 14": [{"count": 151, "outof": 151, "incomplete": false}, {"count": 151, "outof": 151, "incomplete": false}, {"count": 50, "outof": 151, "incomplete": false}, {"count": 54, "outof": 151, "incomplete": false}, {"count": 39, "outof": 151, "incomplete": false}, {"count": 39, "outof": 151, "incomplete": false}, {"count": 34, "outof": 151, "incomplete": false}, {"count": 31, "outof": 151, "incomplete": false}, {"count": 19, "outof": 151, "incomplete": false}, {"count": 22, "outof": 151, "incomplete": true}, {"count": 2, "outof": 151, "incomplete": true}], "Aug 07": [{"count": 131, "outof": 131, "incomplete": false}, {"count": 131, "outof": 131, "incomplete": false}, {"count": 42, "outof": 131, "incomplete": false}, {"count": 38, "outof": 131, "incomplete": false}, {"count": 28, "outof": 131, "incomplete": false}, {"count": 33, "outof": 131, "incomplete": false}, {"count": 27, "outof": 131, "incomplete": false}, {"count": 25, "outof": 131, "incomplete": false}, {"count": 28, "outof": 131, "incomplete": false}, {"count": 18, "outof": 131, "incomplete": false}, {"count": 12, "outof": 131, "incomplete": true}, {"count": 4, "outof": 131, "incomplete": true}], "Jul 31": [{"count": 117, "outof": 117, "incomplete": false}, {"count": 117, "outof": 117, "incomplete": false}, {"count": 49, "outof": 117, "incomplete": false}, {"count": 35, "outof": 117, "incomplete": false}, {"count": 32, "outof": 117, "incomplete": false}, {"count": 34, "outof": 117, "incomplete": false}, {"count": 25, "outof": 117, "incomplete": false}, {"count": 18, "outof": 117, "incomplete": false}, {"count": 18, "outof": 117, "incomplete": false}, {"count": 14, "outof": 117, "incomplete": false}, {"count": 14, "outof": 117, "incomplete": false}, {"count": 9, "outof": 117, "incomplete": true}, {"count": 0, "outof": 117, "incomplete": true}], "Jul 24": [{"count": 120, "outof": 120, "incomplete": false}, {"count": 120, "outof": 120, "incomplete": false}, {"count": 49, "outof": 120, "incomplete": false}, {"count": 37, "outof": 120, "incomplete": false}, {"count": 34, "outof": 120, "incomplete": false}, {"count": 25, "outof": 120, "incomplete": false}, {"count": 25, "outof": 120, "incomplete": false}, {"count": 23, "outof": 120, "incomplete": false}, {"count": 18, "outof": 120, "incomplete": false}, {"count": 20, "outof": 120, "incomplete": false}, {"count": 20, "outof": 120, "incomplete": false}, {"count": 16, "outof": 120, "incomplete": false}, {"count": 12, "outof": 120, "incomplete": true}, {"count": 2, "outof": 120, "incomplete": true}], "Jul 17": [{"count": 121, "outof": 121, "incomplete": false}, {"count": 121, "outof": 121, "incomplete": false}, {"count": 49, "outof": 121, "incomplete": false}, {"count": 41, "outof": 121, "incomplete": false}, {"count": 26, "outof": 121, "incomplete": false}, {"count": 33, "outof": 121, "incomplete": false}, {"count": 30, "outof": 121, "incomplete": false}, {"count": 16, "outof": 121, "incomplete": false}, {"count": 23, "outof": 121, "incomplete": false}, {"count": 19, "outof": 121, "incomplete": false}, {"count": 20, "outof": 121, "incomplete": false}, {"count": 21, "outof": 121, "incomplete": false}, {"count": 17, "outof": 121, "incomplete": false}, {"count": 11, "outof": 121, "incomplete": true}, {"count": 4, "outof": 121, "incomplete": true}], "Jul 10": [{"count": 127, "outof": 127, "incomplete": false}, {"count": 127, "outof": 127, "incomplete": false}, {"count": 43, "outof": 127, "incomplete": false}, {"count": 30, "outof": 127, "incomplete": false}, {"count": 23, "outof": 127, "incomplete": false}, {"count": 34, "outof": 127, "incomplete": false}, {"count": 26, "outof": 127, "incomplete": false}, {"count": 22, "outof": 127, "incomplete": false}, {"count": 20, "outof": 127, "incomplete": false}, {"count": 14, "outof": 127, "incomplete": false}, {"count": 18, "outof": 127, "incomplete": false}, {"count": 17, "outof": 127, "incomplete": false}, {"count": 18, "outof": 127, "incomplete": false}, {"count": 16, "outof": 127, "incomplete": false}, {"count": 12, "outof": 127, "incomplete": true}, {"count": 1, "outof": 127, "incomplete": true}], "Jul 03": [{"count": 114, "outof": 114, "incomplete": false}, {"count": 114, "outof": 114, "incomplete": false}, {"count": 33, "outof": 114, "incomplete": false}, {"count": 33, "outof": 114, "incomplete": false}, {"count": 30, "outof": 114, "incomplete": false}, {"count": 21, "outof": 114, "incomplete": false}, {"count": 25, "outof": 114, "incomplete": false}, {"count": 15, "outof": 114, "incomplete": false}, {"count": 15, "outof": 114, "incomplete": false}, {"count": 18, "outof": 114, "incomplete": false}, {"count": 18, "outof": 114, "incomplete": false}, {"count": 12, "outof": 114, "incomplete": false}, {"count": 11, "outof": 114, "incomplete": false}, {"count": 16, "outof": 114, "incomplete": false}, {"count": 10, "outof": 114, "incomplete": false}, {"count": 8, "outof": 114, "incomplete": true}, {"count": 1, "outof": 114, "incomplete": true}], "Jun 26": [{"count": 122, "outof": 122, "incomplete": false}, {"count": 122, "outof": 122, "incomplete": false}, {"count": 32, "outof": 122, "incomplete": false}, {"count": 36, "outof": 122, "incomplete": false}, {"count": 29, "outof": 122, "incomplete": false}, {"count": 34, "outof": 122, "incomplete": false}, {"count": 34, "outof": 122, "incomplete": false}, {"count": 32, "outof": 122, "incomplete": false}, {"count": 25, "outof": 122, "incomplete": false}, {"count": 24, "outof": 122, "incomplete": false}, {"count": 23, "outof": 122, "incomplete": false}, {"count": 23, "outof": 122, "incomplete": false}, {"count": 16, "outof": 122, "incomplete": false}, {"count": 12, "outof": 122, "incomplete": false}, {"count": 19, "outof": 122, "incomplete": false}, {"count": 14, "outof": 122, "incomplete": false}, {"count": 12, "outof": 122, "incomplete": true}, {"count": 2, "outof": 122, "incomplete": true}]}, "dates": ["Oct 16", "Oct 09", "Oct 02", "Sep 25", "Sep 18", "Sep 11", "Sep 04", "Aug 28", "Aug 21", "Aug 14", "Aug 07", "Jul 31", "Jul 24", "Jul 17", "Jul 10", "Jul 03", "Jun 26"], "datetimes": ["2023-10-16", "2023-10-09", "2023-10-02", "2023-09-25", "2023-09-18", "2023-09-11", "2023-09-04", "2023-08-28", "2023-08-21", "2023-08-14", "2023-08-07", "2023-07-31", "2023-07-24", "2023-07-17", "2023-07-10", "2023-07-03", "2023-06-26"], "combined": [{"count": 1019, "outof": 1019, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 1019, "outof": 1019, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 335, "outof": 966, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 261, "outof": 914, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 208, "outof": 857, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 187, "outof": 810, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 156, "outof": 727, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 123, "outof": 666, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 101, "outof": 609, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 82, "outof": 533, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 66, "outof": 476, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 59, "outof": 414, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 48, "outof": 373, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 35, "outof": 305, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 26, "outof": 211, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 15, "outof": 133, "incomplete": false, "retainedSetId": null, "dropoffSetId": null}, {"count": 12, "outof": 122, "incomplete": true, "retainedSetId": null, "dropoffSetId": null}, {"count": 2, "outof": 122, "incomplete": true, "retainedSetId": null, "dropoffSetId": null}]}], "seriesLabels": [""], "seriesMeta": [{"segmentIndex": 0, "eventIndex": 0}]}, "timeComputed": 1697455667645, "wasCached": false, "cacheFreshness": "FRESH", "novaRuntime": 287, "novaRequestDuration": 296, "novaCost": 6, "throttleTime": 11, "minSampleRate": 1, "transformationIds": [], "backend": "novaV2", "realtimeDataMissing": false, "timedOutRealtimeData": false, "missedCacheAndNotComputed": false, "partialMergedAndNewUserInformation": false, "prunedResult": false, "hitChunkGroupByLimit": false, "subcluster": 9, "millisSinceComputed": 309, "earliestServerReceivedTime": 9223372036854775807, "queryIds": ["vzqTSQf4FM"], "novaRequestStartAndEndTimes": [[1697455667350, 1697455667646]]}} |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import json | ||
|
||
def calculate_weekly_retention(data): | ||
retention_dict = {} | ||
|
||
# Loop through each date and its corresponding values | ||
for date, values in data['session_end']['data']['series'][0]['values'].items(): | ||
weekly_retention = [] | ||
|
||
# Calculate retention rate for each interval (assuming 7-day intervals for weekly retention) | ||
for week_data in values[:7]: | ||
count = week_data['count'] | ||
outof = week_data['outof'] | ||
incomplete = week_data['incomplete'] | ||
|
||
if not incomplete: | ||
retention_rate = (count / outof) * 100 if outof != 0 else 0 | ||
weekly_retention.append(round(retention_rate, 2)) | ||
|
||
retention_dict[date] = weekly_retention | ||
|
||
return retention_dict | ||
|
||
file_path = 'retention_data_NOTIFICATION_TAP_20230901_20230930.json' | ||
|
||
# Read the JSON file | ||
with open(file_path, 'r') as f: | ||
data = json.load(f) | ||
weekly_retention_rates = calculate_weekly_retention(data) | ||
print(weekly_retention_rates) | ||
|
||
# Calculate weekly retention rates |