File tree Expand file tree Collapse file tree 2 files changed +4061
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4061
-4
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 55
66from marketing_attribution_models import MAM
77
8+ np .random .seed (42 )
9+
810pd .set_option ("display.float_format" , lambda x : "%.3f" % x )
911pd .set_option ("max_colwidth" , None )
1012
11- df = pd .read_csv ("/home/luanfernandes/Downloads/sessions.csv" )
13+ users = [
14+ # "1472526294.1645135142",
15+ "1317354717.1641321280" ,
16+ # "679601293.1636465111"
17+ ]
18+
19+ df = pd .read_csv (
20+ "/home/luanfernandes/Downloads/sessions-full.csv" ,
21+ dtype = {
22+ "user_pseudo_id" : str ,
23+ "session_id" : str ,
24+ "user_id" : str ,
25+ "is_conversion" : bool ,
26+ "source_medium" : str ,
27+ "partition_date" : str ,
28+ },
29+ parse_dates = True ,
30+ )
31+ df = df [df .user_pseudo_id .isin (users )].sample (frac = 1.0 )
32+
1233df = df .drop (
1334 columns = [
14- "page_referrer" ,
15- "page_location" ,
35+ # "page_referrer",
36+ # "page_location",
1637 "utm_source" ,
1738 "utm_medium" ,
1839 "utm_campaign" ,
3960DP_tribution .as_pd_dataframe ()
4061
4162DP_tribution .attribution_last_click ()
63+ DP_tribution .attribution_time_decay ()
64+
65+ print (DP_tribution .DataFrame )
66+
67+ print (DP_tribution .original_df )
You can’t perform that action at this time.
0 commit comments