SHARE
TWEET

Untitled

a guest Jul 16th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ```python
  2. import pandas as pd
  3. import numpy as np
  4. import json
  5. from time import time
  6. from ast import literal_eval
  7. from datetime import datetime
  8. import matplotlib.pyplot as plt
  9. import numpy as np
  10.  
  11. import warnings
  12. warnings.filterwarnings('ignore')
  13. ```
  14.  
  15.  
  16. ```python
  17. file_name = 'stats_requests_log_8'
  18. ```
  19.  
  20.  
  21. ```python
  22. f = open(file_name, "r")
  23. fl = f.readlines()
  24.  
  25. df = pd.DataFrame()
  26. index = 0;
  27. t0 = time()
  28.  
  29. for i in fl:
  30.     index = index + 1
  31.     if index % 1000 == 0:
  32.         duration = time() - t0
  33.         print("%s done in %fs" % (index, duration))
  34.     try:
  35.         df = df.append(pd.read_json(i, lines=True, precise_float=True, orient='columns'))
  36.     except ValueError:
  37.         print(i)
  38.  
  39. df.head()
  40. ```
  41.  
  42.  
  43.  
  44.  
  45. <div>
  46. <style scoped>
  47.     .dataframe tbody tr th:only-of-type {
  48.         vertical-align: middle;
  49.     }
  50.  
  51.     .dataframe tbody tr th {
  52.         vertical-align: top;
  53.     }
  54.  
  55.     .dataframe thead th {
  56.         text-align: right;
  57.     }
  58. </style>
  59. <table border="1" class="dataframe">
  60.   <thead>
  61.     <tr style="text-align: right;">
  62.       <th></th>
  63.       <th>ad_units</th>
  64.       <th>request</th>
  65.       <th>timestamp</th>
  66.     </tr>
  67.   </thead>
  68.   <tbody>
  69.     <tr>
  70.       <th>0</th>
  71.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  72.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  73.       <td>2019-06-24 10:47:47</td>
  74.     </tr>
  75.     <tr>
  76.       <th>0</th>
  77.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  78.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  79.       <td>2019-06-24 11:12:41</td>
  80.     </tr>
  81.     <tr>
  82.       <th>0</th>
  83.       <td>[{'campaign_id': 37783, 'image_id': 57195, 'st...</td>
  84.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  85.       <td>2019-06-24 12:19:48</td>
  86.     </tr>
  87.     <tr>
  88.       <th>0</th>
  89.       <td>[{'campaign_id': 126, 'image_id': 480, 'start'...</td>
  90.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  91.       <td>2019-06-24 12:31:04</td>
  92.     </tr>
  93.     <tr>
  94.       <th>0</th>
  95.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  96.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  97.       <td>2019-06-24 12:38:36</td>
  98.     </tr>
  99.   </tbody>
  100. </table>
  101. </div>
  102.  
  103.  
  104.  
  105.  
  106. ```python
  107. df.to_csv(file_name + '.csv', sep=';', encoding='utf-8')
  108. ```
  109.  
  110.  
  111. ```python
  112. df = pd.read_csv(file_name + '.csv', sep=';', encoding='utf-8', low_memory=False)
  113. df.drop(df.columns[0], axis=1, inplace=True)
  114. ```
  115.  
  116.  
  117. ```python
  118. df.shape
  119. ```
  120.  
  121.  
  122.  
  123.  
  124.     (883, 3)
  125.  
  126.  
  127.  
  128.  
  129. ```python
  130. campaigns = [37783]
  131.  
  132. def get_ad_unit(ad_units):
  133.     ad_units_array = literal_eval(str(ad_units))
  134.     for i in ad_units_array:
  135.         if i['campaign_id'] in campaigns:
  136.             return i
  137.     return -1;
  138.  
  139. def is_ad_units_last(ad_units):
  140.     ad_units_array = literal_eval(str(ad_units))
  141.     length = len(ad_units_array)
  142.     for i in ad_units_array:
  143.         if i['campaign_id'] in campaigns:
  144.             return ad_units_array.index(i) == length - 1
  145.     return False;
  146.  
  147.  
  148. def get_campaign_id(ad_units):
  149.     ad_units_array = literal_eval(str(ad_units))
  150.     length = len(ad_units_array)
  151.     for i in ad_units_array:
  152.         if i['campaign_id'] in campaigns:
  153.             return i['campaign_id']
  154.     return -1;
  155.  
  156.  
  157.  
  158. df["ad_unit"] = df['ad_units'].apply(get_ad_unit)
  159. df["last"] = df['ad_units'].apply(is_ad_units_last)
  160. df["campaign_id"] = df['ad_units'].apply(get_campaign_id)
  161.  
  162.  
  163. ```
  164.  
  165.  
  166. ```python
  167. df.head()
  168. ```
  169.  
  170.  
  171.  
  172.  
  173. <div>
  174. <style scoped>
  175.     .dataframe tbody tr th:only-of-type {
  176.         vertical-align: middle;
  177.     }
  178.  
  179.     .dataframe tbody tr th {
  180.         vertical-align: top;
  181.     }
  182.  
  183.     .dataframe thead th {
  184.         text-align: right;
  185.     }
  186. </style>
  187. <table border="1" class="dataframe">
  188.   <thead>
  189.     <tr style="text-align: right;">
  190.       <th></th>
  191.       <th>ad_units</th>
  192.       <th>request</th>
  193.       <th>timestamp</th>
  194.       <th>ad_unit</th>
  195.       <th>last</th>
  196.       <th>campaign_id</th>
  197.     </tr>
  198.   </thead>
  199.   <tbody>
  200.     <tr>
  201.       <th>0</th>
  202.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  203.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  204.       <td>2019-06-24 10:47:47</td>
  205.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  206.       <td>False</td>
  207.       <td>37783</td>
  208.     </tr>
  209.     <tr>
  210.       <th>1</th>
  211.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  212.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  213.       <td>2019-06-24 11:12:41</td>
  214.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  215.       <td>False</td>
  216.       <td>37783</td>
  217.     </tr>
  218.     <tr>
  219.       <th>2</th>
  220.       <td>[{'campaign_id': 37783, 'image_id': 57195, 'st...</td>
  221.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  222.       <td>2019-06-24 12:19:48</td>
  223.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  224.       <td>True</td>
  225.       <td>37783</td>
  226.     </tr>
  227.     <tr>
  228.       <th>3</th>
  229.       <td>[{'campaign_id': 126, 'image_id': 480, 'start'...</td>
  230.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  231.       <td>2019-06-24 12:31:04</td>
  232.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  233.       <td>True</td>
  234.       <td>37783</td>
  235.     </tr>
  236.     <tr>
  237.       <th>4</th>
  238.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  239.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  240.       <td>2019-06-24 12:38:36</td>
  241.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  242.       <td>False</td>
  243.       <td>37783</td>
  244.     </tr>
  245.   </tbody>
  246. </table>
  247. </div>
  248.  
  249.  
  250.  
  251.  
  252. ```python
  253. df_with_campaign = df[df.ad_unit != -1]
  254. df_with_campaign.shape
  255. ```
  256.  
  257.  
  258.  
  259.  
  260.     (883, 6)
  261.  
  262.  
  263.  
  264.  
  265. ```python
  266. df_with_campaign.head()
  267. ```
  268.  
  269.  
  270.  
  271.  
  272. <div>
  273. <style scoped>
  274.     .dataframe tbody tr th:only-of-type {
  275.         vertical-align: middle;
  276.     }
  277.  
  278.     .dataframe tbody tr th {
  279.         vertical-align: top;
  280.     }
  281.  
  282.     .dataframe thead th {
  283.         text-align: right;
  284.     }
  285. </style>
  286. <table border="1" class="dataframe">
  287.   <thead>
  288.     <tr style="text-align: right;">
  289.       <th></th>
  290.       <th>ad_units</th>
  291.       <th>request</th>
  292.       <th>timestamp</th>
  293.       <th>ad_unit</th>
  294.       <th>last</th>
  295.       <th>campaign_id</th>
  296.     </tr>
  297.   </thead>
  298.   <tbody>
  299.     <tr>
  300.       <th>0</th>
  301.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  302.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  303.       <td>2019-06-24 10:47:47</td>
  304.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  305.       <td>False</td>
  306.       <td>37783</td>
  307.     </tr>
  308.     <tr>
  309.       <th>1</th>
  310.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  311.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  312.       <td>2019-06-24 11:12:41</td>
  313.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  314.       <td>False</td>
  315.       <td>37783</td>
  316.     </tr>
  317.     <tr>
  318.       <th>2</th>
  319.       <td>[{'campaign_id': 37783, 'image_id': 57195, 'st...</td>
  320.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  321.       <td>2019-06-24 12:19:48</td>
  322.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  323.       <td>True</td>
  324.       <td>37783</td>
  325.     </tr>
  326.     <tr>
  327.       <th>3</th>
  328.       <td>[{'campaign_id': 126, 'image_id': 480, 'start'...</td>
  329.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  330.       <td>2019-06-24 12:31:04</td>
  331.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  332.       <td>True</td>
  333.       <td>37783</td>
  334.     </tr>
  335.     <tr>
  336.       <th>4</th>
  337.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  338.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  339.       <td>2019-06-24 12:38:36</td>
  340.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  341.       <td>False</td>
  342.       <td>37783</td>
  343.     </tr>
  344.   </tbody>
  345. </table>
  346. </div>
  347.  
  348.  
  349.  
  350.  
  351. ```python
  352. def get_stats(request):
  353.     request = literal_eval(str(request))
  354.     return request['stats']
  355.  
  356.  
  357. df_with_campaign["stats"] = df_with_campaign['request'].apply(get_stats)
  358. df_with_campaign.head()
  359. ```
  360.  
  361.  
  362.  
  363.  
  364. <div>
  365. <style scoped>
  366.     .dataframe tbody tr th:only-of-type {
  367.         vertical-align: middle;
  368.     }
  369.  
  370.     .dataframe tbody tr th {
  371.         vertical-align: top;
  372.     }
  373.  
  374.     .dataframe thead th {
  375.         text-align: right;
  376.     }
  377. </style>
  378. <table border="1" class="dataframe">
  379.   <thead>
  380.     <tr style="text-align: right;">
  381.       <th></th>
  382.       <th>ad_units</th>
  383.       <th>request</th>
  384.       <th>timestamp</th>
  385.       <th>ad_unit</th>
  386.       <th>last</th>
  387.       <th>campaign_id</th>
  388.       <th>stats</th>
  389.     </tr>
  390.   </thead>
  391.   <tbody>
  392.     <tr>
  393.       <th>0</th>
  394.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  395.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  396.       <td>2019-06-24 10:47:47</td>
  397.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  398.       <td>False</td>
  399.       <td>37783</td>
  400.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  401.     </tr>
  402.     <tr>
  403.       <th>1</th>
  404.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  405.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  406.       <td>2019-06-24 11:12:41</td>
  407.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  408.       <td>False</td>
  409.       <td>37783</td>
  410.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  411.     </tr>
  412.     <tr>
  413.       <th>2</th>
  414.       <td>[{'campaign_id': 37783, 'image_id': 57195, 'st...</td>
  415.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  416.       <td>2019-06-24 12:19:48</td>
  417.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  418.       <td>True</td>
  419.       <td>37783</td>
  420.       <td>{'start': 1561378786907, 'finish': 15613787888...</td>
  421.     </tr>
  422.     <tr>
  423.       <th>3</th>
  424.       <td>[{'campaign_id': 126, 'image_id': 480, 'start'...</td>
  425.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  426.       <td>2019-06-24 12:31:04</td>
  427.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  428.       <td>True</td>
  429.       <td>37783</td>
  430.       <td>{'start': 1561379438223, 'finish': 15613794636...</td>
  431.     </tr>
  432.     <tr>
  433.       <th>4</th>
  434.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  435.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  436.       <td>2019-06-24 12:38:36</td>
  437.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  438.       <td>False</td>
  439.       <td>37783</td>
  440.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  441.     </tr>
  442.   </tbody>
  443. </table>
  444. </div>
  445.  
  446.  
  447.  
  448.  
  449. ```python
  450. def get_ad_unit_result(ad_unit):
  451.     ad_units_data = literal_eval(str(ad_unit))
  452.     return ad_units_data.get('result', -1);
  453.  
  454. df_with_campaign["ad_unit_result"] = df_with_campaign['ad_unit'].apply(get_ad_unit_result)
  455. df_with_campaign.head()
  456. ```
  457.  
  458.  
  459.  
  460.  
  461. <div>
  462. <style scoped>
  463.     .dataframe tbody tr th:only-of-type {
  464.         vertical-align: middle;
  465.     }
  466.  
  467.     .dataframe tbody tr th {
  468.         vertical-align: top;
  469.     }
  470.  
  471.     .dataframe thead th {
  472.         text-align: right;
  473.     }
  474. </style>
  475. <table border="1" class="dataframe">
  476.   <thead>
  477.     <tr style="text-align: right;">
  478.       <th></th>
  479.       <th>ad_units</th>
  480.       <th>request</th>
  481.       <th>timestamp</th>
  482.       <th>ad_unit</th>
  483.       <th>last</th>
  484.       <th>campaign_id</th>
  485.       <th>stats</th>
  486.       <th>ad_unit_result</th>
  487.     </tr>
  488.   </thead>
  489.   <tbody>
  490.     <tr>
  491.       <th>0</th>
  492.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  493.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  494.       <td>2019-06-24 10:47:47</td>
  495.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  496.       <td>False</td>
  497.       <td>37783</td>
  498.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  499.       <td>0</td>
  500.     </tr>
  501.     <tr>
  502.       <th>1</th>
  503.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  504.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  505.       <td>2019-06-24 11:12:41</td>
  506.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  507.       <td>False</td>
  508.       <td>37783</td>
  509.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  510.       <td>1</td>
  511.     </tr>
  512.     <tr>
  513.       <th>2</th>
  514.       <td>[{'campaign_id': 37783, 'image_id': 57195, 'st...</td>
  515.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  516.       <td>2019-06-24 12:19:48</td>
  517.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  518.       <td>True</td>
  519.       <td>37783</td>
  520.       <td>{'start': 1561378786907, 'finish': 15613787888...</td>
  521.       <td>0</td>
  522.     </tr>
  523.     <tr>
  524.       <th>3</th>
  525.       <td>[{'campaign_id': 126, 'image_id': 480, 'start'...</td>
  526.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  527.       <td>2019-06-24 12:31:04</td>
  528.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  529.       <td>True</td>
  530.       <td>37783</td>
  531.       <td>{'start': 1561379438223, 'finish': 15613794636...</td>
  532.       <td>0</td>
  533.     </tr>
  534.     <tr>
  535.       <th>4</th>
  536.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  537.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  538.       <td>2019-06-24 12:38:36</td>
  539.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  540.       <td>False</td>
  541.       <td>37783</td>
  542.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  543.       <td>1</td>
  544.     </tr>
  545.   </tbody>
  546. </table>
  547. </div>
  548.  
  549.  
  550.  
  551.  
  552. ```python
  553. def get_ad_unit_start(ad_unit):
  554.     ad_units_data = literal_eval(str(ad_unit))
  555.     return ad_units_data.get('start', -1);
  556.  
  557. def get_ad_unit_finish(ad_unit):
  558.     ad_units_data = literal_eval(str(ad_unit))
  559.     return ad_units_data.get('finish', -1);
  560.  
  561. def get_stats_start(request):
  562.     ad_units_data = literal_eval(str(request))
  563.     return ad_units_data['stats'].get('start', -1);
  564.  
  565. def get_stats_finish(request):
  566.     ad_units_data = literal_eval(str(request))
  567.     return ad_units_data['stats'].get('finish', -1);
  568.  
  569.  
  570. def get_connectiontype(request):
  571.     request_data = literal_eval(str(request))
  572.     return request_data['device'].get('connectiontype', -1)
  573.  
  574. def get_lmt(request):
  575.     request_data = literal_eval(str(request))
  576.     return request_data['device'].get('lmt', -1)
  577.  
  578. def get_model(request):
  579.     request_data = literal_eval(str(request))
  580.     return request_data['device'].get('model', "UNKNOWN")
  581.  
  582. def get_ifa(request):
  583.     request_data = literal_eval(str(request))
  584.     return request_data['device'].get('ifa', "UNKNOWN")
  585.  
  586. def get_stats_result(stats):
  587.     stats_data = literal_eval(str(stats))
  588.     return stats_data.get('successful', False)
  589.  
  590. def get_osv(request):
  591.     request_data = literal_eval(str(request))
  592.     return request_data['device'].get('osv', "UNKNOWN")
  593.  
  594. def get_sdk(request):
  595.     request_data = literal_eval(str(request))
  596.     return request_data['app'].get('sdk', "UNKNOWN")
  597.  
  598. def get_ver(request):
  599.     request_data = literal_eval(str(request))
  600.     return request_data['app'].get('ver', "UNKNOWN")
  601.  
  602. def get_consent(request):
  603.     request_data = literal_eval(str(request))
  604.     return str(request_data['user'].get('consent', "UNKNOWN"))
  605.  
  606. def get_locale(request):
  607.     request_data = literal_eval(str(request))
  608.     return str(request_data['device'].get('locale', "UNKNOWN"))
  609.  
  610. def get_webview_version(request):
  611.     request_data = literal_eval(str(request))
  612.     return str(request_data['device'].get('webview_version', "UNKNOWN"))
  613.  
  614. def get_mccmnc(request):
  615.     request_data = literal_eval(str(request))
  616.     return str(request_data['device'].get('mccmnc', "UNKNOWN"))
  617.  
  618. def get_ua(request):
  619.     request_data = literal_eval(str(request))
  620.     return str(request_data['device'].get('ua', "UNKNOWN"))
  621.  
  622. def get_session_id(request):
  623.     request_data = literal_eval(str(request))
  624.     return str(request_data['session'].get('session_id', -1))
  625.  
  626. def get_session_uuid(request):
  627.     request_data = literal_eval(str(request))
  628.     return str(request_data['session'].get('session_uuid', "-1"))
  629.  
  630.  
  631. def get_session_uptime(request):
  632.     request_data = literal_eval(str(request))
  633.     return request_data['session'].get('session_uptime', 0)
  634.  
  635.  
  636. df_with_campaign["ad_unit_start"] = df_with_campaign['ad_unit'].apply(get_ad_unit_start)
  637. df_with_campaign["ad_unit_finish"] = df_with_campaign['ad_unit'].apply(get_ad_unit_finish)
  638. df_with_campaign["ad_unit_interval"] = df_with_campaign['ad_unit_finish'] - df_with_campaign['ad_unit_start']
  639.  
  640. df_with_campaign["stats_successful"] = df_with_campaign['stats'].apply(get_stats_result)
  641.  
  642. df_with_campaign["lmt"] = df_with_campaign['request'].apply(get_lmt)
  643. df_with_campaign["model"] = df_with_campaign['request'].apply(get_model)
  644. df_with_campaign["ifa"] = df_with_campaign['request'].apply(get_ifa)
  645. df_with_campaign["osv"] = df_with_campaign['request'].apply(get_osv)
  646. df_with_campaign["connectiontype"] = df_with_campaign['request'].apply(get_connectiontype)
  647. df_with_campaign["sdk"] = df_with_campaign['request'].apply(get_sdk)
  648. df_with_campaign["ver"] = df_with_campaign['request'].apply(get_ver)
  649. df_with_campaign["consent"] = df_with_campaign['request'].apply(get_consent)
  650. df_with_campaign["locale"] = df_with_campaign['request'].apply(get_locale)
  651. df_with_campaign["webview_version"] = df_with_campaign['request'].apply(get_webview_version)
  652. df_with_campaign["mccmnc"] = df_with_campaign['request'].apply(get_mccmnc)
  653. df_with_campaign["ua"] = df_with_campaign['request'].apply(get_ua)
  654. df_with_campaign["stats_start"] = df_with_campaign['request'].apply(get_stats_start)
  655. df_with_campaign["stats_finish"] = df_with_campaign['request'].apply(get_stats_finish)
  656. df_with_campaign["stats_delta"] = df_with_campaign["stats_finish"] - df_with_campaign["stats_start"]
  657.  
  658. df_with_campaign["session_id"] = df_with_campaign['request'].apply(get_session_id)
  659. df_with_campaign["session_uuid"] = df_with_campaign['request'].apply(get_session_uuid)
  660. df_with_campaign["session_uptime"] = df_with_campaign['request'].apply(get_session_uptime)
  661.  
  662. ```
  663.  
  664.  
  665. ```python
  666. x = range(0, 21)
  667. y = []
  668. for i in x:
  669.     count = df_with_campaign[(df_with_campaign.ad_unit_interval >= i * 1000) & (df_with_campaign.ad_unit_interval < (i + 1) * 1000)].shape[0]
  670.     y.append(count)
  671.  
  672. plt.title("Requests")
  673. plt.xlabel("Interval")
  674. plt.ylabel("Count")
  675. plt.grid()
  676.  
  677. plt.bar(x, y)
  678.  
  679. plt.show()
  680.  
  681. ```
  682.  
  683.  
  684. ![png](output_13_0.png)
  685.  
  686.  
  687.  
  688. ```python
  689. df_with_campaign_failed = df_with_campaign[df_with_campaign.ad_unit_result != 0]
  690. df_with_campaign_failed.head(df_with_campaign_failed.shape[0])
  691. ```
  692.  
  693.  
  694.  
  695.  
  696. <div>
  697. <style scoped>
  698.     .dataframe tbody tr th:only-of-type {
  699.         vertical-align: middle;
  700.     }
  701.  
  702.     .dataframe tbody tr th {
  703.         vertical-align: top;
  704.     }
  705.  
  706.     .dataframe thead th {
  707.         text-align: right;
  708.     }
  709. </style>
  710. <table border="1" class="dataframe">
  711.   <thead>
  712.     <tr style="text-align: right;">
  713.       <th></th>
  714.       <th>ad_units</th>
  715.       <th>request</th>
  716.       <th>timestamp</th>
  717.       <th>ad_unit</th>
  718.       <th>last</th>
  719.       <th>campaign_id</th>
  720.       <th>stats</th>
  721.       <th>ad_unit_result</th>
  722.       <th>ad_unit_start</th>
  723.       <th>ad_unit_finish</th>
  724.       <th>...</th>
  725.       <th>locale</th>
  726.       <th>webview_version</th>
  727.       <th>mccmnc</th>
  728.       <th>ua</th>
  729.       <th>stats_start</th>
  730.       <th>stats_finish</th>
  731.       <th>stats_delta</th>
  732.       <th>session_id</th>
  733.       <th>session_uuid</th>
  734.       <th>session_uptime</th>
  735.     </tr>
  736.   </thead>
  737.   <tbody>
  738.     <tr>
  739.       <th>1</th>
  740.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  741.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  742.       <td>2019-06-24 11:12:41</td>
  743.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  744.       <td>False</td>
  745.       <td>37783</td>
  746.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  747.       <td>1</td>
  748.       <td>0</td>
  749.       <td>0</td>
  750.       <td>...</td>
  751.       <td>UNKNOWN</td>
  752.       <td>UNKNOWN</td>
  753.       <td>UNKNOWN</td>
  754.       <td>UNKNOWN</td>
  755.       <td>-1</td>
  756.       <td>-1</td>
  757.       <td>0</td>
  758.       <td>-1</td>
  759.       <td>-1</td>
  760.       <td>0</td>
  761.     </tr>
  762.     <tr>
  763.       <th>4</th>
  764.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  765.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  766.       <td>2019-06-24 12:38:36</td>
  767.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  768.       <td>False</td>
  769.       <td>37783</td>
  770.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  771.       <td>1</td>
  772.       <td>0</td>
  773.       <td>0</td>
  774.       <td>...</td>
  775.       <td>UNKNOWN</td>
  776.       <td>UNKNOWN</td>
  777.       <td>UNKNOWN</td>
  778.       <td>UNKNOWN</td>
  779.       <td>-1</td>
  780.       <td>-1</td>
  781.       <td>0</td>
  782.       <td>-1</td>
  783.       <td>-1</td>
  784.       <td>0</td>
  785.     </tr>
  786.     <tr>
  787.       <th>5</th>
  788.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  789.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  790.       <td>2019-06-24 12:42:04</td>
  791.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  792.       <td>True</td>
  793.       <td>37783</td>
  794.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  795.       <td>1</td>
  796.       <td>0</td>
  797.       <td>0</td>
  798.       <td>...</td>
  799.       <td>UNKNOWN</td>
  800.       <td>UNKNOWN</td>
  801.       <td>UNKNOWN</td>
  802.       <td>UNKNOWN</td>
  803.       <td>-1</td>
  804.       <td>-1</td>
  805.       <td>0</td>
  806.       <td>-1</td>
  807.       <td>-1</td>
  808.       <td>0</td>
  809.     </tr>
  810.     <tr>
  811.       <th>7</th>
  812.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  813.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  814.       <td>2019-06-24 14:17:48</td>
  815.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  816.       <td>True</td>
  817.       <td>37783</td>
  818.       <td>{'start': 1561379792664, 'finish': 15613858591...</td>
  819.       <td>2</td>
  820.       <td>1561385848760</td>
  821.       <td>1561385859153</td>
  822.       <td>...</td>
  823.       <td>en-US</td>
  824.       <td>UNKNOWN</td>
  825.       <td>310-120</td>
  826.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like...</td>
  827.       <td>1561379792664</td>
  828.       <td>1561385859153</td>
  829.       <td>6066489</td>
  830.       <td>26</td>
  831.       <td>60c65e87-dbb3-4e58-a61b-7100d98b48ad</td>
  832.       <td>86</td>
  833.     </tr>
  834.     <tr>
  835.       <th>8</th>
  836.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  837.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  838.       <td>2019-06-24 14:47:43</td>
  839.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  840.       <td>False</td>
  841.       <td>37783</td>
  842.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  843.       <td>1</td>
  844.       <td>0</td>
  845.       <td>0</td>
  846.       <td>...</td>
  847.       <td>UNKNOWN</td>
  848.       <td>UNKNOWN</td>
  849.       <td>UNKNOWN</td>
  850.       <td>UNKNOWN</td>
  851.       <td>-1</td>
  852.       <td>-1</td>
  853.       <td>0</td>
  854.       <td>-1</td>
  855.       <td>-1</td>
  856.       <td>0</td>
  857.     </tr>
  858.     <tr>
  859.       <th>9</th>
  860.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  861.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  862.       <td>2019-06-24 14:51:21</td>
  863.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  864.       <td>True</td>
  865.       <td>37783</td>
  866.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  867.       <td>1</td>
  868.       <td>0</td>
  869.       <td>0</td>
  870.       <td>...</td>
  871.       <td>UNKNOWN</td>
  872.       <td>UNKNOWN</td>
  873.       <td>UNKNOWN</td>
  874.       <td>UNKNOWN</td>
  875.       <td>-1</td>
  876.       <td>-1</td>
  877.       <td>0</td>
  878.       <td>-1</td>
  879.       <td>-1</td>
  880.       <td>0</td>
  881.     </tr>
  882.     <tr>
  883.       <th>11</th>
  884.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  885.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  886.       <td>2019-06-24 15:19:25</td>
  887.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  888.       <td>False</td>
  889.       <td>37783</td>
  890.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  891.       <td>1</td>
  892.       <td>0</td>
  893.       <td>0</td>
  894.       <td>...</td>
  895.       <td>UNKNOWN</td>
  896.       <td>UNKNOWN</td>
  897.       <td>UNKNOWN</td>
  898.       <td>UNKNOWN</td>
  899.       <td>-1</td>
  900.       <td>-1</td>
  901.       <td>0</td>
  902.       <td>-1</td>
  903.       <td>-1</td>
  904.       <td>0</td>
  905.     </tr>
  906.     <tr>
  907.       <th>12</th>
  908.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  909.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  910.       <td>2019-06-24 15:22:54</td>
  911.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  912.       <td>True</td>
  913.       <td>37783</td>
  914.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  915.       <td>1</td>
  916.       <td>0</td>
  917.       <td>0</td>
  918.       <td>...</td>
  919.       <td>UNKNOWN</td>
  920.       <td>UNKNOWN</td>
  921.       <td>UNKNOWN</td>
  922.       <td>UNKNOWN</td>
  923.       <td>-1</td>
  924.       <td>-1</td>
  925.       <td>0</td>
  926.       <td>-1</td>
  927.       <td>-1</td>
  928.       <td>0</td>
  929.     </tr>
  930.     <tr>
  931.       <th>14</th>
  932.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  933.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  934.       <td>2019-06-24 17:28:15</td>
  935.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  936.       <td>True</td>
  937.       <td>37783</td>
  938.       <td>{'start': 1561397177191, 'finish': 15613972950...</td>
  939.       <td>2</td>
  940.       <td>1561397285017</td>
  941.       <td>1561397295047</td>
  942.       <td>...</td>
  943.       <td>en-GB</td>
  944.       <td>UNKNOWN</td>
  945.       <td>234-10</td>
  946.       <td>Mozilla/5.0 (iPad; CPU OS 12_3_1 like Mac OS X...</td>
  947.       <td>1561397177191</td>
  948.       <td>1561397295047</td>
  949.       <td>117856</td>
  950.       <td>134</td>
  951.       <td>91149d6c-d31b-4051-ae85-1e6f9ee70ffc</td>
  952.       <td>122</td>
  953.     </tr>
  954.     <tr>
  955.       <th>16</th>
  956.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  957.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  958.       <td>2019-06-24 18:39:33</td>
  959.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  960.       <td>True</td>
  961.       <td>37783</td>
  962.       <td>{'start': 1561401158786, 'finish': 15614015716...</td>
  963.       <td>2</td>
  964.       <td>1561401561622</td>
  965.       <td>1561401571630</td>
  966.       <td>...</td>
  967.       <td>en-US</td>
  968.       <td>UNKNOWN</td>
  969.       <td>311-580</td>
  970.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like...</td>
  971.       <td>1561401158786</td>
  972.       <td>1561401571630</td>
  973.       <td>412844</td>
  974.       <td>397</td>
  975.       <td>d98b19c3-9b20-4f67-9194-3f30b9895db6</td>
  976.       <td>412</td>
  977.     </tr>
  978.     <tr>
  979.       <th>18</th>
  980.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  981.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  982.       <td>2019-06-24 18:57:30</td>
  983.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  984.       <td>True</td>
  985.       <td>37783</td>
  986.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  987.       <td>1</td>
  988.       <td>0</td>
  989.       <td>0</td>
  990.       <td>...</td>
  991.       <td>UNKNOWN</td>
  992.       <td>UNKNOWN</td>
  993.       <td>UNKNOWN</td>
  994.       <td>UNKNOWN</td>
  995.       <td>-1</td>
  996.       <td>-1</td>
  997.       <td>0</td>
  998.       <td>-1</td>
  999.       <td>-1</td>
  1000.       <td>0</td>
  1001.     </tr>
  1002.     <tr>
  1003.       <th>19</th>
  1004.       <td>[{'campaign_id': 126, 'image_id': 480, 'start'...</td>
  1005.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1006.       <td>2019-06-24 19:23:29</td>
  1007.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1008.       <td>True</td>
  1009.       <td>37783</td>
  1010.       <td>{'start': 1561403993131, 'finish': 15614042087...</td>
  1011.       <td>2</td>
  1012.       <td>1561404198134</td>
  1013.       <td>1561404208755</td>
  1014.       <td>...</td>
  1015.       <td>nl-NL</td>
  1016.       <td>UNKNOWN</td>
  1017.       <td>UNKNOWN</td>
  1018.       <td>Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X)...</td>
  1019.       <td>1561403993131</td>
  1020.       <td>1561404208757</td>
  1021.       <td>215626</td>
  1022.       <td>519</td>
  1023.       <td>a4f41830-c361-4a04-8f2d-27b16dcfc613</td>
  1024.       <td>239</td>
  1025.     </tr>
  1026.     <tr>
  1027.       <th>20</th>
  1028.       <td>[{'campaign_id': 126, 'image_id': 480, 'start'...</td>
  1029.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1030.       <td>2019-06-24 19:35:52</td>
  1031.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1032.       <td>True</td>
  1033.       <td>37783</td>
  1034.       <td>{'start': 1561404616259, 'finish': 15614049369...</td>
  1035.       <td>2</td>
  1036.       <td>1561404926773</td>
  1037.       <td>1561404936987</td>
  1038.       <td>...</td>
  1039.       <td>fr-CA</td>
  1040.       <td>UNKNOWN</td>
  1041.       <td>UNKNOWN</td>
  1042.       <td>Mozilla/5.0 (iPad; CPU OS 12_3_1 like Mac OS X...</td>
  1043.       <td>1561404616259</td>
  1044.       <td>1561404936987</td>
  1045.       <td>320728</td>
  1046.       <td>93</td>
  1047.       <td>abd921b4-a1cd-48df-a3d6-0c8b5e9b89db</td>
  1048.       <td>323</td>
  1049.     </tr>
  1050.     <tr>
  1051.       <th>22</th>
  1052.       <td>[{'campaign_id': 126, 'image_id': 480, 'start'...</td>
  1053.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1054.       <td>2019-06-24 20:20:20</td>
  1055.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1056.       <td>True</td>
  1057.       <td>37783</td>
  1058.       <td>{'start': 1561407578614, 'finish': 15614076201...</td>
  1059.       <td>1</td>
  1060.       <td>1561407620099</td>
  1061.       <td>1561407620119</td>
  1062.       <td>...</td>
  1063.       <td>en-AU</td>
  1064.       <td>UNKNOWN</td>
  1065.       <td>505-01</td>
  1066.       <td>Mozilla/5.0 (iPad; CPU OS 12_3_1 like Mac OS X...</td>
  1067.       <td>1561407578614</td>
  1068.       <td>1561407620119</td>
  1069.       <td>41505</td>
  1070.       <td>79</td>
  1071.       <td>450251a3-0169-4636-a1a5-d682716c7c7a</td>
  1072.       <td>1702</td>
  1073.     </tr>
  1074.     <tr>
  1075.       <th>23</th>
  1076.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1077.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1078.       <td>2019-06-24 20:53:06</td>
  1079.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1080.       <td>True</td>
  1081.       <td>37783</td>
  1082.       <td>{'start': 1561409259014, 'finish': 15614095835...</td>
  1083.       <td>2</td>
  1084.       <td>1561409573504</td>
  1085.       <td>1561409583587</td>
  1086.       <td>...</td>
  1087.       <td>en-US</td>
  1088.       <td>UNKNOWN</td>
  1089.       <td>311-480</td>
  1090.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like...</td>
  1091.       <td>1561409259014</td>
  1092.       <td>1561409583587</td>
  1093.       <td>324573</td>
  1094.       <td>33</td>
  1095.       <td>06378928-1e58-4321-b008-f3ce1b618652</td>
  1096.       <td>1113</td>
  1097.     </tr>
  1098.     <tr>
  1099.       <th>24</th>
  1100.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1101.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1102.       <td>2019-06-24 21:17:07</td>
  1103.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1104.       <td>False</td>
  1105.       <td>37783</td>
  1106.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1107.       <td>1</td>
  1108.       <td>0</td>
  1109.       <td>0</td>
  1110.       <td>...</td>
  1111.       <td>UNKNOWN</td>
  1112.       <td>UNKNOWN</td>
  1113.       <td>UNKNOWN</td>
  1114.       <td>UNKNOWN</td>
  1115.       <td>-1</td>
  1116.       <td>-1</td>
  1117.       <td>0</td>
  1118.       <td>-1</td>
  1119.       <td>-1</td>
  1120.       <td>0</td>
  1121.     </tr>
  1122.     <tr>
  1123.       <th>25</th>
  1124.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1125.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1126.       <td>2019-06-24 21:20:45</td>
  1127.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1128.       <td>True</td>
  1129.       <td>37783</td>
  1130.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1131.       <td>1</td>
  1132.       <td>0</td>
  1133.       <td>0</td>
  1134.       <td>...</td>
  1135.       <td>UNKNOWN</td>
  1136.       <td>UNKNOWN</td>
  1137.       <td>UNKNOWN</td>
  1138.       <td>UNKNOWN</td>
  1139.       <td>-1</td>
  1140.       <td>-1</td>
  1141.       <td>0</td>
  1142.       <td>-1</td>
  1143.       <td>-1</td>
  1144.       <td>0</td>
  1145.     </tr>
  1146.     <tr>
  1147.       <th>26</th>
  1148.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1149.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1150.       <td>2019-06-24 21:22:49</td>
  1151.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1152.       <td>True</td>
  1153.       <td>37783</td>
  1154.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1155.       <td>1</td>
  1156.       <td>0</td>
  1157.       <td>0</td>
  1158.       <td>...</td>
  1159.       <td>UNKNOWN</td>
  1160.       <td>UNKNOWN</td>
  1161.       <td>UNKNOWN</td>
  1162.       <td>UNKNOWN</td>
  1163.       <td>-1</td>
  1164.       <td>-1</td>
  1165.       <td>0</td>
  1166.       <td>-1</td>
  1167.       <td>-1</td>
  1168.       <td>0</td>
  1169.     </tr>
  1170.     <tr>
  1171.       <th>27</th>
  1172.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1173.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1174.       <td>2019-06-24 21:29:37</td>
  1175.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1176.       <td>True</td>
  1177.       <td>37783</td>
  1178.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1179.       <td>1</td>
  1180.       <td>0</td>
  1181.       <td>0</td>
  1182.       <td>...</td>
  1183.       <td>UNKNOWN</td>
  1184.       <td>UNKNOWN</td>
  1185.       <td>UNKNOWN</td>
  1186.       <td>UNKNOWN</td>
  1187.       <td>-1</td>
  1188.       <td>-1</td>
  1189.       <td>0</td>
  1190.       <td>-1</td>
  1191.       <td>-1</td>
  1192.       <td>0</td>
  1193.     </tr>
  1194.     <tr>
  1195.       <th>28</th>
  1196.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1197.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1198.       <td>2019-06-24 22:33:51</td>
  1199.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1200.       <td>True</td>
  1201.       <td>37783</td>
  1202.       <td>{'start': 1561416188852, 'finish': 15614163258...</td>
  1203.       <td>2</td>
  1204.       <td>1561416315819</td>
  1205.       <td>1561416325877</td>
  1206.       <td>...</td>
  1207.       <td>en-PH</td>
  1208.       <td>UNKNOWN</td>
  1209.       <td>515-02</td>
  1210.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_5 like ...</td>
  1211.       <td>1561416188852</td>
  1212.       <td>1561416325877</td>
  1213.       <td>137025</td>
  1214.       <td>499</td>
  1215.       <td>8f29454f-5b2c-4aaf-959f-fa8d2b45a205</td>
  1216.       <td>28</td>
  1217.     </tr>
  1218.     <tr>
  1219.       <th>30</th>
  1220.       <td>[{'campaign_id': 126, 'image_id': 480, 'start'...</td>
  1221.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1222.       <td>2019-06-24 16:46:50</td>
  1223.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1224.       <td>True</td>
  1225.       <td>37783</td>
  1226.       <td>{'start': 1561394479006, 'finish': 15613947904...</td>
  1227.       <td>2</td>
  1228.       <td>1561394779976</td>
  1229.       <td>1561394790482</td>
  1230.       <td>...</td>
  1231.       <td>en-US</td>
  1232.       <td>UNKNOWN</td>
  1233.       <td>311-480</td>
  1234.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like...</td>
  1235.       <td>1561394479006</td>
  1236.       <td>1561394790482</td>
  1237.       <td>311476</td>
  1238.       <td>204</td>
  1239.       <td>9a4c4636-4fa8-4463-9e18-8a167ae7c0b9</td>
  1240.       <td>60</td>
  1241.     </tr>
  1242.     <tr>
  1243.       <th>33</th>
  1244.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1245.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1246.       <td>2019-06-24 21:21:29</td>
  1247.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1248.       <td>True</td>
  1249.       <td>37783</td>
  1250.       <td>{'start': 1561410936799, 'finish': 15614112695...</td>
  1251.       <td>2</td>
  1252.       <td>1561411259593</td>
  1253.       <td>1561411269596</td>
  1254.       <td>...</td>
  1255.       <td>en-US</td>
  1256.       <td>UNKNOWN</td>
  1257.       <td>UNKNOWN</td>
  1258.       <td>Mozilla/5.0 (iPad; CPU OS 12_3_1 like Mac OS X...</td>
  1259.       <td>1561410936799</td>
  1260.       <td>1561411269596</td>
  1261.       <td>332797</td>
  1262.       <td>73</td>
  1263.       <td>70fd71ce-0033-4a22-a277-91f762da97bf</td>
  1264.       <td>2284</td>
  1265.     </tr>
  1266.     <tr>
  1267.       <th>34</th>
  1268.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1269.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1270.       <td>2019-06-24 21:25:12</td>
  1271.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1272.       <td>True</td>
  1273.       <td>37783</td>
  1274.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1275.       <td>1</td>
  1276.       <td>0</td>
  1277.       <td>0</td>
  1278.       <td>...</td>
  1279.       <td>UNKNOWN</td>
  1280.       <td>UNKNOWN</td>
  1281.       <td>UNKNOWN</td>
  1282.       <td>UNKNOWN</td>
  1283.       <td>-1</td>
  1284.       <td>-1</td>
  1285.       <td>0</td>
  1286.       <td>-1</td>
  1287.       <td>-1</td>
  1288.       <td>0</td>
  1289.     </tr>
  1290.     <tr>
  1291.       <th>35</th>
  1292.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1293.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1294.       <td>2019-06-24 21:27:23</td>
  1295.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1296.       <td>True</td>
  1297.       <td>37783</td>
  1298.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1299.       <td>1</td>
  1300.       <td>0</td>
  1301.       <td>0</td>
  1302.       <td>...</td>
  1303.       <td>UNKNOWN</td>
  1304.       <td>UNKNOWN</td>
  1305.       <td>UNKNOWN</td>
  1306.       <td>UNKNOWN</td>
  1307.       <td>-1</td>
  1308.       <td>-1</td>
  1309.       <td>0</td>
  1310.       <td>-1</td>
  1311.       <td>-1</td>
  1312.       <td>0</td>
  1313.     </tr>
  1314.     <tr>
  1315.       <th>36</th>
  1316.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1317.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1318.       <td>2019-06-24 21:33:53</td>
  1319.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1320.       <td>False</td>
  1321.       <td>37783</td>
  1322.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1323.       <td>1</td>
  1324.       <td>0</td>
  1325.       <td>0</td>
  1326.       <td>...</td>
  1327.       <td>UNKNOWN</td>
  1328.       <td>UNKNOWN</td>
  1329.       <td>UNKNOWN</td>
  1330.       <td>UNKNOWN</td>
  1331.       <td>-1</td>
  1332.       <td>-1</td>
  1333.       <td>0</td>
  1334.       <td>-1</td>
  1335.       <td>-1</td>
  1336.       <td>0</td>
  1337.     </tr>
  1338.     <tr>
  1339.       <th>38</th>
  1340.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1341.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1342.       <td>2019-06-24 21:37:11</td>
  1343.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1344.       <td>True</td>
  1345.       <td>37783</td>
  1346.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1347.       <td>1</td>
  1348.       <td>0</td>
  1349.       <td>0</td>
  1350.       <td>...</td>
  1351.       <td>UNKNOWN</td>
  1352.       <td>UNKNOWN</td>
  1353.       <td>UNKNOWN</td>
  1354.       <td>UNKNOWN</td>
  1355.       <td>-1</td>
  1356.       <td>-1</td>
  1357.       <td>0</td>
  1358.       <td>-1</td>
  1359.       <td>-1</td>
  1360.       <td>0</td>
  1361.     </tr>
  1362.     <tr>
  1363.       <th>39</th>
  1364.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1365.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1366.       <td>2019-06-24 21:41:14</td>
  1367.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1368.       <td>True</td>
  1369.       <td>37783</td>
  1370.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1371.       <td>1</td>
  1372.       <td>0</td>
  1373.       <td>0</td>
  1374.       <td>...</td>
  1375.       <td>UNKNOWN</td>
  1376.       <td>UNKNOWN</td>
  1377.       <td>UNKNOWN</td>
  1378.       <td>UNKNOWN</td>
  1379.       <td>-1</td>
  1380.       <td>-1</td>
  1381.       <td>0</td>
  1382.       <td>-1</td>
  1383.       <td>-1</td>
  1384.       <td>0</td>
  1385.     </tr>
  1386.     <tr>
  1387.       <th>40</th>
  1388.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1389.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1390.       <td>2019-06-24 21:43:26</td>
  1391.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1392.       <td>True</td>
  1393.       <td>37783</td>
  1394.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1395.       <td>1</td>
  1396.       <td>0</td>
  1397.       <td>0</td>
  1398.       <td>...</td>
  1399.       <td>UNKNOWN</td>
  1400.       <td>UNKNOWN</td>
  1401.       <td>UNKNOWN</td>
  1402.       <td>UNKNOWN</td>
  1403.       <td>-1</td>
  1404.       <td>-1</td>
  1405.       <td>0</td>
  1406.       <td>-1</td>
  1407.       <td>-1</td>
  1408.       <td>0</td>
  1409.     </tr>
  1410.     <tr>
  1411.       <th>41</th>
  1412.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1413.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1414.       <td>2019-06-24 21:45:45</td>
  1415.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1416.       <td>True</td>
  1417.       <td>37783</td>
  1418.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1419.       <td>1</td>
  1420.       <td>0</td>
  1421.       <td>0</td>
  1422.       <td>...</td>
  1423.       <td>UNKNOWN</td>
  1424.       <td>UNKNOWN</td>
  1425.       <td>UNKNOWN</td>
  1426.       <td>UNKNOWN</td>
  1427.       <td>-1</td>
  1428.       <td>-1</td>
  1429.       <td>0</td>
  1430.       <td>-1</td>
  1431.       <td>-1</td>
  1432.       <td>0</td>
  1433.     </tr>
  1434.     <tr>
  1435.       <th>42</th>
  1436.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1437.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1438.       <td>2019-06-24 21:59:57</td>
  1439.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1440.       <td>True</td>
  1441.       <td>37783</td>
  1442.       <td>{'start': 1561413231998, 'finish': 15614135940...</td>
  1443.       <td>2</td>
  1444.       <td>1561413583922</td>
  1445.       <td>1561413594057</td>
  1446.       <td>...</td>
  1447.       <td>en-US</td>
  1448.       <td>UNKNOWN</td>
  1449.       <td>310-120</td>
  1450.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like...</td>
  1451.       <td>1561413231998</td>
  1452.       <td>1561413594058</td>
  1453.       <td>362060</td>
  1454.       <td>473</td>
  1455.       <td>fbf8e4d8-4de9-4ed5-8136-237f71151bcc</td>
  1456.       <td>7</td>
  1457.     </tr>
  1458.     <tr>
  1459.       <th>...</th>
  1460.       <td>...</td>
  1461.       <td>...</td>
  1462.       <td>...</td>
  1463.       <td>...</td>
  1464.       <td>...</td>
  1465.       <td>...</td>
  1466.       <td>...</td>
  1467.       <td>...</td>
  1468.       <td>...</td>
  1469.       <td>...</td>
  1470.       <td>...</td>
  1471.       <td>...</td>
  1472.       <td>...</td>
  1473.       <td>...</td>
  1474.       <td>...</td>
  1475.       <td>...</td>
  1476.       <td>...</td>
  1477.       <td>...</td>
  1478.       <td>...</td>
  1479.       <td>...</td>
  1480.       <td>...</td>
  1481.     </tr>
  1482.     <tr>
  1483.       <th>832</th>
  1484.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1485.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1486.       <td>2019-07-03 17:22:49</td>
  1487.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1488.       <td>True</td>
  1489.       <td>37783</td>
  1490.       <td>{'start': 1562174413050, 'finish': 15621745686...</td>
  1491.       <td>2</td>
  1492.       <td>1562174558416</td>
  1493.       <td>1562174568621</td>
  1494.       <td>...</td>
  1495.       <td>en-GB</td>
  1496.       <td>UNKNOWN</td>
  1497.       <td>UNKNOWN</td>
  1498.       <td>Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X)...</td>
  1499.       <td>1562174413050</td>
  1500.       <td>1562174568621</td>
  1501.       <td>155571</td>
  1502.       <td>179</td>
  1503.       <td>1726aeca-f306-4f94-97d6-edbf35880205</td>
  1504.       <td>160</td>
  1505.     </tr>
  1506.     <tr>
  1507.       <th>838</th>
  1508.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1509.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1510.       <td>2019-07-03 18:48:04</td>
  1511.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1512.       <td>True</td>
  1513.       <td>37783</td>
  1514.       <td>{'start': 1562179359736, 'finish': 15621796814...</td>
  1515.       <td>2</td>
  1516.       <td>1562179671477</td>
  1517.       <td>1562179681477</td>
  1518.       <td>...</td>
  1519.       <td>en-US</td>
  1520.       <td>UNKNOWN</td>
  1521.       <td>310-260</td>
  1522.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like...</td>
  1523.       <td>1562179359736</td>
  1524.       <td>1562179681478</td>
  1525.       <td>321742</td>
  1526.       <td>6</td>
  1527.       <td>4a097c33-f975-4dce-ab4f-4faaead80b5e</td>
  1528.       <td>347</td>
  1529.     </tr>
  1530.     <tr>
  1531.       <th>839</th>
  1532.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1533.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1534.       <td>2019-07-03 18:56:17</td>
  1535.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1536.       <td>True</td>
  1537.       <td>37783</td>
  1538.       <td>{'start': 1562179800474, 'finish': 15621801553...</td>
  1539.       <td>2</td>
  1540.       <td>1562180145300</td>
  1541.       <td>1562180155394</td>
  1542.       <td>...</td>
  1543.       <td>en-US</td>
  1544.       <td>UNKNOWN</td>
  1545.       <td>310-260</td>
  1546.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like...</td>
  1547.       <td>1562179800474</td>
  1548.       <td>1562180155394</td>
  1549.       <td>354920</td>
  1550.       <td>35</td>
  1551.       <td>94cc7606-d24d-478a-bbe1-61ee67a7b0cc</td>
  1552.       <td>644</td>
  1553.     </tr>
  1554.     <tr>
  1555.       <th>840</th>
  1556.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1557.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1558.       <td>2019-07-03 02:12:53</td>
  1559.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1560.       <td>True</td>
  1561.       <td>37783</td>
  1562.       <td>{'start': 1562119740429, 'finish': 15621199595...</td>
  1563.       <td>2</td>
  1564.       <td>1562119949589</td>
  1565.       <td>1562119959589</td>
  1566.       <td>...</td>
  1567.       <td>en-US</td>
  1568.       <td>UNKNOWN</td>
  1569.       <td>311-480</td>
  1570.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like...</td>
  1571.       <td>1562119740429</td>
  1572.       <td>1562119959590</td>
  1573.       <td>219161</td>
  1574.       <td>277</td>
  1575.       <td>f7ca57e1-7afa-42d9-b935-055b07b9c32a</td>
  1576.       <td>460</td>
  1577.     </tr>
  1578.     <tr>
  1579.       <th>842</th>
  1580.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1581.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1582.       <td>2019-07-03 15:40:09</td>
  1583.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1584.       <td>True</td>
  1585.       <td>37783</td>
  1586.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1587.       <td>1</td>
  1588.       <td>0</td>
  1589.       <td>0</td>
  1590.       <td>...</td>
  1591.       <td>UNKNOWN</td>
  1592.       <td>UNKNOWN</td>
  1593.       <td>UNKNOWN</td>
  1594.       <td>UNKNOWN</td>
  1595.       <td>-1</td>
  1596.       <td>-1</td>
  1597.       <td>0</td>
  1598.       <td>-1</td>
  1599.       <td>-1</td>
  1600.       <td>0</td>
  1601.     </tr>
  1602.     <tr>
  1603.       <th>843</th>
  1604.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1605.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1606.       <td>2019-07-03 18:50:50</td>
  1607.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1608.       <td>True</td>
  1609.       <td>37783</td>
  1610.       <td>{'start': 1562179696259, 'finish': 15621798491...</td>
  1611.       <td>2</td>
  1612.       <td>1562179839025</td>
  1613.       <td>1562179849122</td>
  1614.       <td>...</td>
  1615.       <td>en-GB</td>
  1616.       <td>UNKNOWN</td>
  1617.       <td>UNKNOWN</td>
  1618.       <td>Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X)...</td>
  1619.       <td>1562179696259</td>
  1620.       <td>1562179849123</td>
  1621.       <td>152864</td>
  1622.       <td>181</td>
  1623.       <td>8d4a4aca-9040-4e06-ab45-04fc0873616a</td>
  1624.       <td>156</td>
  1625.     </tr>
  1626.     <tr>
  1627.       <th>844</th>
  1628.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1629.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1630.       <td>2019-07-03 19:34:54</td>
  1631.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1632.       <td>True</td>
  1633.       <td>37783</td>
  1634.       <td>{'start': 1562182238641, 'finish': 15621824686...</td>
  1635.       <td>2</td>
  1636.       <td>1562182458621</td>
  1637.       <td>1562182468656</td>
  1638.       <td>...</td>
  1639.       <td>en-PH</td>
  1640.       <td>UNKNOWN</td>
  1641.       <td>515-03</td>
  1642.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like...</td>
  1643.       <td>1562182238641</td>
  1644.       <td>1562182468656</td>
  1645.       <td>230015</td>
  1646.       <td>527</td>
  1647.       <td>60c1c0be-1f11-4527-a5be-21f85256ccbe</td>
  1648.       <td>251</td>
  1649.     </tr>
  1650.     <tr>
  1651.       <th>845</th>
  1652.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1653.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1654.       <td>2019-07-03 20:35:04</td>
  1655.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1656.       <td>True</td>
  1657.       <td>37783</td>
  1658.       <td>{'start': 1562185558702, 'finish': 15621861046...</td>
  1659.       <td>2</td>
  1660.       <td>1562186094421</td>
  1661.       <td>1562186104611</td>
  1662.       <td>...</td>
  1663.       <td>fr-FR</td>
  1664.       <td>UNKNOWN</td>
  1665.       <td>UNKNOWN</td>
  1666.       <td>Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) ...</td>
  1667.       <td>1562185558702</td>
  1668.       <td>1562186104611</td>
  1669.       <td>545909</td>
  1670.       <td>2</td>
  1671.       <td>be72551e-ea72-4451-8e5e-adeae2b14d70</td>
  1672.       <td>246</td>
  1673.     </tr>
  1674.     <tr>
  1675.       <th>846</th>
  1676.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1677.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1678.       <td>2019-07-03 03:49:33</td>
  1679.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1680.       <td>True</td>
  1681.       <td>37783</td>
  1682.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1683.       <td>1</td>
  1684.       <td>0</td>
  1685.       <td>0</td>
  1686.       <td>...</td>
  1687.       <td>UNKNOWN</td>
  1688.       <td>UNKNOWN</td>
  1689.       <td>UNKNOWN</td>
  1690.       <td>UNKNOWN</td>
  1691.       <td>-1</td>
  1692.       <td>-1</td>
  1693.       <td>0</td>
  1694.       <td>-1</td>
  1695.       <td>-1</td>
  1696.       <td>0</td>
  1697.     </tr>
  1698.     <tr>
  1699.       <th>847</th>
  1700.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1701.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1702.       <td>2019-07-03 03:57:32</td>
  1703.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1704.       <td>True</td>
  1705.       <td>37783</td>
  1706.       <td>{'start': 1562125833078, 'finish': 15621262435...</td>
  1707.       <td>2</td>
  1708.       <td>1562126233271</td>
  1709.       <td>1562126243521</td>
  1710.       <td>...</td>
  1711.       <td>en-US</td>
  1712.       <td>UNKNOWN</td>
  1713.       <td>310-410</td>
  1714.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_2 like...</td>
  1715.       <td>1562125833078</td>
  1716.       <td>1562126243521</td>
  1717.       <td>410443</td>
  1718.       <td>765</td>
  1719.       <td>8b0dea77-b636-4b45-9c67-6f1db4e2b585</td>
  1720.       <td>424</td>
  1721.     </tr>
  1722.     <tr>
  1723.       <th>848</th>
  1724.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1725.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1726.       <td>2019-07-03 20:57:58</td>
  1727.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1728.       <td>False</td>
  1729.       <td>37783</td>
  1730.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1731.       <td>1</td>
  1732.       <td>0</td>
  1733.       <td>0</td>
  1734.       <td>...</td>
  1735.       <td>UNKNOWN</td>
  1736.       <td>UNKNOWN</td>
  1737.       <td>UNKNOWN</td>
  1738.       <td>UNKNOWN</td>
  1739.       <td>-1</td>
  1740.       <td>-1</td>
  1741.       <td>0</td>
  1742.       <td>-1</td>
  1743.       <td>-1</td>
  1744.       <td>0</td>
  1745.     </tr>
  1746.     <tr>
  1747.       <th>849</th>
  1748.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1749.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1750.       <td>2019-07-03 21:10:40</td>
  1751.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1752.       <td>False</td>
  1753.       <td>37783</td>
  1754.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1755.       <td>1</td>
  1756.       <td>0</td>
  1757.       <td>0</td>
  1758.       <td>...</td>
  1759.       <td>UNKNOWN</td>
  1760.       <td>UNKNOWN</td>
  1761.       <td>UNKNOWN</td>
  1762.       <td>UNKNOWN</td>
  1763.       <td>-1</td>
  1764.       <td>-1</td>
  1765.       <td>0</td>
  1766.       <td>-1</td>
  1767.       <td>-1</td>
  1768.       <td>0</td>
  1769.     </tr>
  1770.     <tr>
  1771.       <th>850</th>
  1772.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1773.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1774.       <td>2019-07-03 22:22:35</td>
  1775.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1776.       <td>True</td>
  1777.       <td>37783</td>
  1778.       <td>{'start': 1562192164941, 'finish': 15621925009...</td>
  1779.       <td>2</td>
  1780.       <td>1562192490671</td>
  1781.       <td>1562192500978</td>
  1782.       <td>...</td>
  1783.       <td>en-US</td>
  1784.       <td>UNKNOWN</td>
  1785.       <td>310-120</td>
  1786.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like...</td>
  1787.       <td>1562192164941</td>
  1788.       <td>1562192500978</td>
  1789.       <td>336037</td>
  1790.       <td>1110</td>
  1791.       <td>766c8243-1e1c-4b82-8af1-4216dc71b120</td>
  1792.       <td>379</td>
  1793.     </tr>
  1794.     <tr>
  1795.       <th>852</th>
  1796.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1797.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1798.       <td>2019-07-03 11:31:40</td>
  1799.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1800.       <td>True</td>
  1801.       <td>37783</td>
  1802.       <td>{'start': 1562153347722, 'finish': 15621534991...</td>
  1803.       <td>2</td>
  1804.       <td>1562153489062</td>
  1805.       <td>1562153499172</td>
  1806.       <td>...</td>
  1807.       <td>en-GB</td>
  1808.       <td>UNKNOWN</td>
  1809.       <td>UNKNOWN</td>
  1810.       <td>Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X)...</td>
  1811.       <td>1562153347722</td>
  1812.       <td>1562153499172</td>
  1813.       <td>151450</td>
  1814.       <td>177</td>
  1815.       <td>827464fc-9c27-4cbd-b4a6-98412ca4a265</td>
  1816.       <td>154</td>
  1817.     </tr>
  1818.     <tr>
  1819.       <th>853</th>
  1820.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1821.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1822.       <td>2019-07-03 12:39:11</td>
  1823.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1824.       <td>True</td>
  1825.       <td>37783</td>
  1826.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1827.       <td>1</td>
  1828.       <td>0</td>
  1829.       <td>0</td>
  1830.       <td>...</td>
  1831.       <td>UNKNOWN</td>
  1832.       <td>UNKNOWN</td>
  1833.       <td>UNKNOWN</td>
  1834.       <td>UNKNOWN</td>
  1835.       <td>-1</td>
  1836.       <td>-1</td>
  1837.       <td>0</td>
  1838.       <td>-1</td>
  1839.       <td>-1</td>
  1840.       <td>0</td>
  1841.     </tr>
  1842.     <tr>
  1843.       <th>854</th>
  1844.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1845.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1846.       <td>2019-07-03 15:33:06</td>
  1847.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1848.       <td>False</td>
  1849.       <td>37783</td>
  1850.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1851.       <td>1</td>
  1852.       <td>0</td>
  1853.       <td>0</td>
  1854.       <td>...</td>
  1855.       <td>UNKNOWN</td>
  1856.       <td>UNKNOWN</td>
  1857.       <td>UNKNOWN</td>
  1858.       <td>UNKNOWN</td>
  1859.       <td>-1</td>
  1860.       <td>-1</td>
  1861.       <td>0</td>
  1862.       <td>-1</td>
  1863.       <td>-1</td>
  1864.       <td>0</td>
  1865.     </tr>
  1866.     <tr>
  1867.       <th>857</th>
  1868.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1869.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1870.       <td>2019-07-03 11:36:06</td>
  1871.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1872.       <td>True</td>
  1873.       <td>37783</td>
  1874.       <td>{'start': 1562153421321, 'finish': 15621537618...</td>
  1875.       <td>2</td>
  1876.       <td>1562153751708</td>
  1877.       <td>1562153761813</td>
  1878.       <td>...</td>
  1879.       <td>en-US</td>
  1880.       <td>UNKNOWN</td>
  1881.       <td>310-260</td>
  1882.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_4 like...</td>
  1883.       <td>1562153421321</td>
  1884.       <td>1562153761815</td>
  1885.       <td>340494</td>
  1886.       <td>216</td>
  1887.       <td>17144400-daa7-4c6d-881f-1bc03adade68</td>
  1888.       <td>577</td>
  1889.     </tr>
  1890.     <tr>
  1891.       <th>858</th>
  1892.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1893.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1894.       <td>2019-07-03 11:41:49</td>
  1895.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1896.       <td>True</td>
  1897.       <td>37783</td>
  1898.       <td>{'start': 1562153950427, 'finish': 15621541077...</td>
  1899.       <td>2</td>
  1900.       <td>1562154097592</td>
  1901.       <td>1562154107714</td>
  1902.       <td>...</td>
  1903.       <td>en-GB</td>
  1904.       <td>UNKNOWN</td>
  1905.       <td>UNKNOWN</td>
  1906.       <td>Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X)...</td>
  1907.       <td>1562153950427</td>
  1908.       <td>1562154107714</td>
  1909.       <td>157287</td>
  1910.       <td>178</td>
  1911.       <td>9df0692e-a937-4469-ad4b-14ff9e5b574a</td>
  1912.       <td>159</td>
  1913.     </tr>
  1914.     <tr>
  1915.       <th>859</th>
  1916.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  1917.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  1918.       <td>2019-07-03 15:36:10</td>
  1919.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1920.       <td>True</td>
  1921.       <td>37783</td>
  1922.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  1923.       <td>1</td>
  1924.       <td>0</td>
  1925.       <td>0</td>
  1926.       <td>...</td>
  1927.       <td>UNKNOWN</td>
  1928.       <td>UNKNOWN</td>
  1929.       <td>UNKNOWN</td>
  1930.       <td>UNKNOWN</td>
  1931.       <td>-1</td>
  1932.       <td>-1</td>
  1933.       <td>0</td>
  1934.       <td>-1</td>
  1935.       <td>-1</td>
  1936.       <td>0</td>
  1937.     </tr>
  1938.     <tr>
  1939.       <th>860</th>
  1940.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1941.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1942.       <td>2019-07-04 00:56:34</td>
  1943.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1944.       <td>True</td>
  1945.       <td>37783</td>
  1946.       <td>{'start': 1562201695010, 'finish': 15622017912...</td>
  1947.       <td>2</td>
  1948.       <td>1562201781041</td>
  1949.       <td>1562201791203</td>
  1950.       <td>...</td>
  1951.       <td>fr-GP</td>
  1952.       <td>UNKNOWN</td>
  1953.       <td>UNKNOWN</td>
  1954.       <td>Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X)...</td>
  1955.       <td>1562201695010</td>
  1956.       <td>1562201791212</td>
  1957.       <td>96202</td>
  1958.       <td>33</td>
  1959.       <td>25066f19-4eb6-4dcf-a2fd-1e3ba0a1b0ba</td>
  1960.       <td>421</td>
  1961.     </tr>
  1962.     <tr>
  1963.       <th>865</th>
  1964.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  1965.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1966.       <td>2019-07-04 08:02:34</td>
  1967.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1968.       <td>True</td>
  1969.       <td>37783</td>
  1970.       <td>{'start': 1562227203335, 'finish': 15622273529...</td>
  1971.       <td>2</td>
  1972.       <td>1562227342851</td>
  1973.       <td>1562227352932</td>
  1974.       <td>...</td>
  1975.       <td>en-GB</td>
  1976.       <td>UNKNOWN</td>
  1977.       <td>UNKNOWN</td>
  1978.       <td>Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X)...</td>
  1979.       <td>1562227203335</td>
  1980.       <td>1562227352938</td>
  1981.       <td>149603</td>
  1982.       <td>184</td>
  1983.       <td>b530259d-65a1-42c1-9eae-8b106cc03435</td>
  1984.       <td>152</td>
  1985.     </tr>
  1986.     <tr>
  1987.       <th>866</th>
  1988.       <td>[{'campaign_id': 126, 'image_id': 480, 'start'...</td>
  1989.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  1990.       <td>2019-07-04 04:34:29</td>
  1991.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  1992.       <td>True</td>
  1993.       <td>37783</td>
  1994.       <td>{'start': 1562214612095, 'finish': 15622148598...</td>
  1995.       <td>2</td>
  1996.       <td>1562214849807</td>
  1997.       <td>1562214859874</td>
  1998.       <td>...</td>
  1999.       <td>en-MY</td>
  2000.       <td>UNKNOWN</td>
  2001.       <td>502-18</td>
  2002.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like...</td>
  2003.       <td>1562214612095</td>
  2004.       <td>1562214859874</td>
  2005.       <td>247779</td>
  2006.       <td>10</td>
  2007.       <td>ffdc8fcc-1df1-4036-b1b3-b7c72c82e3e8</td>
  2008.       <td>465</td>
  2009.     </tr>
  2010.     <tr>
  2011.       <th>867</th>
  2012.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  2013.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  2014.       <td>2019-07-04 01:28:54</td>
  2015.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  2016.       <td>True</td>
  2017.       <td>37783</td>
  2018.       <td>{'start': 1562203360371, 'finish': 15622037259...</td>
  2019.       <td>2</td>
  2020.       <td>1562203715499</td>
  2021.       <td>1562203725985</td>
  2022.       <td>...</td>
  2023.       <td>en-US</td>
  2024.       <td>UNKNOWN</td>
  2025.       <td>311-480</td>
  2026.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like M...</td>
  2027.       <td>1562203360371</td>
  2028.       <td>1562203725985</td>
  2029.       <td>365614</td>
  2030.       <td>248</td>
  2031.       <td>35d82d17-2106-46f8-9422-213e10341e9c</td>
  2032.       <td>713</td>
  2033.     </tr>
  2034.     <tr>
  2035.       <th>869</th>
  2036.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  2037.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  2038.       <td>2019-07-04 05:37:28</td>
  2039.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  2040.       <td>True</td>
  2041.       <td>37783</td>
  2042.       <td>{'start': 1562218304639, 'finish': 15622186276...</td>
  2043.       <td>2</td>
  2044.       <td>1562218617479</td>
  2045.       <td>1562218627643</td>
  2046.       <td>...</td>
  2047.       <td>en-US</td>
  2048.       <td>UNKNOWN</td>
  2049.       <td>311-480</td>
  2050.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like...</td>
  2051.       <td>1562218304639</td>
  2052.       <td>1562218627643</td>
  2053.       <td>323004</td>
  2054.       <td>7</td>
  2055.       <td>17ceb034-665e-4e53-b4bf-ffd4376942fd</td>
  2056.       <td>571</td>
  2057.     </tr>
  2058.     <tr>
  2059.       <th>872</th>
  2060.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  2061.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  2062.       <td>2019-07-04 06:17:12</td>
  2063.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  2064.       <td>True</td>
  2065.       <td>37783</td>
  2066.       <td>{'start': 1562220741515, 'finish': 15622210270...</td>
  2067.       <td>2</td>
  2068.       <td>1562221017042</td>
  2069.       <td>1562221027046</td>
  2070.       <td>...</td>
  2071.       <td>en-GB</td>
  2072.       <td>UNKNOWN</td>
  2073.       <td>UNKNOWN</td>
  2074.       <td>Mozilla/5.0 (iPad; CPU OS 12_3_1 like Mac OS X...</td>
  2075.       <td>1562220741515</td>
  2076.       <td>1562221027046</td>
  2077.       <td>285531</td>
  2078.       <td>201</td>
  2079.       <td>bdc55304-07f4-4137-83bd-ba0415801031</td>
  2080.       <td>721</td>
  2081.     </tr>
  2082.     <tr>
  2083.       <th>876</th>
  2084.       <td>[{'campaign_id': 126, 'image_id': 480, 'start'...</td>
  2085.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  2086.       <td>2019-07-04 00:41:02</td>
  2087.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  2088.       <td>True</td>
  2089.       <td>37783</td>
  2090.       <td>{'start': 1562200820681, 'finish': 15622008611...</td>
  2091.       <td>2</td>
  2092.       <td>1562200851001</td>
  2093.       <td>1562200861174</td>
  2094.       <td>...</td>
  2095.       <td>en-TT</td>
  2096.       <td>UNKNOWN</td>
  2097.       <td>UNKNOWN</td>
  2098.       <td>Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X)...</td>
  2099.       <td>1562200820681</td>
  2100.       <td>1562200861174</td>
  2101.       <td>40493</td>
  2102.       <td>546</td>
  2103.       <td>920755bf-368c-4c82-b14b-1dd214f0ecd7</td>
  2104.       <td>64</td>
  2105.     </tr>
  2106.     <tr>
  2107.       <th>877</th>
  2108.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  2109.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  2110.       <td>2019-07-04 00:43:04</td>
  2111.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  2112.       <td>True</td>
  2113.       <td>37783</td>
  2114.       <td>{'start': 1562200581786, 'finish': 15622009793...</td>
  2115.       <td>2</td>
  2116.       <td>1562200969327</td>
  2117.       <td>1562200979341</td>
  2118.       <td>...</td>
  2119.       <td>en-US</td>
  2120.       <td>UNKNOWN</td>
  2121.       <td>UNKNOWN</td>
  2122.       <td>Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X)...</td>
  2123.       <td>1562200581786</td>
  2124.       <td>1562200979341</td>
  2125.       <td>397555</td>
  2126.       <td>3</td>
  2127.       <td>72717396-23d3-4354-bf8d-70e84d99b684</td>
  2128.       <td>812</td>
  2129.     </tr>
  2130.     <tr>
  2131.       <th>879</th>
  2132.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  2133.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  2134.       <td>2019-07-04 00:56:29</td>
  2135.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  2136.       <td>True</td>
  2137.       <td>37783</td>
  2138.       <td>{'start': 1562201439675, 'finish': 15622017660...</td>
  2139.       <td>2</td>
  2140.       <td>1562201755184</td>
  2141.       <td>1562201766008</td>
  2142.       <td>...</td>
  2143.       <td>en-US</td>
  2144.       <td>UNKNOWN</td>
  2145.       <td>311-480</td>
  2146.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_3 like...</td>
  2147.       <td>1562201439675</td>
  2148.       <td>1562201766008</td>
  2149.       <td>326333</td>
  2150.       <td>345</td>
  2151.       <td>ba79d245-7c10-4878-9579-b98b0083da51</td>
  2152.       <td>411</td>
  2153.     </tr>
  2154.     <tr>
  2155.       <th>880</th>
  2156.       <td>[{'campaign_id': 8375, 'image_id': 14919, 'sta...</td>
  2157.       <td>{'app': {'app_key': '940c2349ac493ff18c2b1f599...</td>
  2158.       <td>2019-07-04 01:12:35</td>
  2159.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  2160.       <td>False</td>
  2161.       <td>37783</td>
  2162.       <td>{'capacity': 1, 'ad_unit': [{'id': '{"image_id...</td>
  2163.       <td>1</td>
  2164.       <td>0</td>
  2165.       <td>0</td>
  2166.       <td>...</td>
  2167.       <td>UNKNOWN</td>
  2168.       <td>UNKNOWN</td>
  2169.       <td>UNKNOWN</td>
  2170.       <td>UNKNOWN</td>
  2171.       <td>-1</td>
  2172.       <td>-1</td>
  2173.       <td>0</td>
  2174.       <td>-1</td>
  2175.       <td>-1</td>
  2176.       <td>0</td>
  2177.     </tr>
  2178.     <tr>
  2179.       <th>881</th>
  2180.       <td>[{'campaign_id': 125, 'image_id': 479, 'start'...</td>
  2181.       <td>{'app': {'bundle': 'com.donkeysoft.wordwow', '...</td>
  2182.       <td>2019-07-04 02:50:38</td>
  2183.       <td>{'campaign_id': 37783, 'image_id': 57195, 'sta...</td>
  2184.       <td>True</td>
  2185.       <td>37783</td>
  2186.       <td>{'start': 1562208313044, 'finish': 15622086314...</td>
  2187.       <td>2</td>
  2188.       <td>1562208620495</td>
  2189.       <td>1562208631412</td>
  2190.       <td>...</td>
  2191.       <td>en-US</td>
  2192.       <td>UNKNOWN</td>
  2193.       <td>311-580</td>
  2194.       <td>Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like...</td>
  2195.       <td>1562208313044</td>
  2196.       <td>1562208631413</td>
  2197.       <td>318369</td>
  2198.       <td>391</td>
  2199.       <td>8730dc36-26a1-4aad-8d93-e38e18ccc1a4</td>
  2200.       <td>323</td>
  2201.     </tr>
  2202.   </tbody>
  2203. </table>
  2204. <p>531 rows × 30 columns</p>
  2205. </div>
  2206.  
  2207.  
  2208.  
  2209.  
  2210. ```python
  2211. table = df_with_campaign.pivot_table(index='ad_unit_result', columns='last', values='timestamp', aggfunc=len, fill_value=0)
  2212. table
  2213.  
  2214. ```
  2215.  
  2216.  
  2217.  
  2218.  
  2219. <div>
  2220. <style scoped>
  2221.     .dataframe tbody tr th:only-of-type {
  2222.         vertical-align: middle;
  2223.     }
  2224.  
  2225.     .dataframe tbody tr th {
  2226.         vertical-align: top;
  2227.     }
  2228.  
  2229.     .dataframe thead th {
  2230.         text-align: right;
  2231.     }
  2232. </style>
  2233. <table border="1" class="dataframe">
  2234.   <thead>
  2235.     <tr style="text-align: right;">
  2236.       <th>last</th>
  2237.       <th>False</th>
  2238.       <th>True</th>
  2239.     </tr>
  2240.     <tr>
  2241.       <th>ad_unit_result</th>
  2242.       <th></th>
  2243.       <th></th>
  2244.     </tr>
  2245.   </thead>
  2246.   <tbody>
  2247.     <tr>
  2248.       <th>0</th>
  2249.       <td>38</td>
  2250.       <td>314</td>
  2251.     </tr>
  2252.     <tr>
  2253.       <th>1</th>
  2254.       <td>69</td>
  2255.       <td>84</td>
  2256.     </tr>
  2257.     <tr>
  2258.       <th>2</th>
  2259.       <td>0</td>
  2260.       <td>378</td>
  2261.     </tr>
  2262.   </tbody>
  2263. </table>
  2264. </div>
  2265.  
  2266.  
  2267.  
  2268.  
  2269. ```python
  2270. table = df_with_campaign.pivot_table(index='ad_unit_result', columns='campaign_id', values='timestamp', margins=True, aggfunc=len, fill_value=0)
  2271. table
  2272.  
  2273. ```
  2274.  
  2275.  
  2276.  
  2277.  
  2278. <div>
  2279. <style scoped>
  2280.     .dataframe tbody tr th:only-of-type {
  2281.         vertical-align: middle;
  2282.     }
  2283.  
  2284.     .dataframe tbody tr th {
  2285.         vertical-align: top;
  2286.     }
  2287.  
  2288.     .dataframe thead th {
  2289.         text-align: right;
  2290.     }
  2291. </style>
  2292. <table border="1" class="dataframe">
  2293.   <thead>
  2294.     <tr style="text-align: right;">
  2295.       <th>campaign_id</th>
  2296.       <th>37783</th>
  2297.       <th>All</th>
  2298.     </tr>
  2299.     <tr>
  2300.       <th>ad_unit_result</th>
  2301.       <th></th>
  2302.       <th></th>
  2303.     </tr>
  2304.   </thead>
  2305.   <tbody>
  2306.     <tr>
  2307.       <th>0</th>
  2308.       <td>352</td>
  2309.       <td>352</td>
  2310.     </tr>
  2311.     <tr>
  2312.       <th>1</th>
  2313.       <td>153</td>
  2314.       <td>153</td>
  2315.     </tr>
  2316.     <tr>
  2317.       <th>2</th>
  2318.       <td>378</td>
  2319.       <td>378</td>
  2320.     </tr>
  2321.     <tr>
  2322.       <th>All</th>
  2323.       <td>883</td>
  2324.       <td>883</td>
  2325.     </tr>
  2326.   </tbody>
  2327. </table>
  2328. </div>
  2329.  
  2330.  
  2331.  
  2332.  
  2333. ```python
  2334. table = df_with_campaign.pivot_table(index='ad_unit_result', columns='sdk', values='timestamp', aggfunc=len, fill_value=0)
  2335. table
  2336.  
  2337. ```
  2338.  
  2339.  
  2340.  
  2341.  
  2342. <div>
  2343. <style scoped>
  2344.     .dataframe tbody tr th:only-of-type {
  2345.         vertical-align: middle;
  2346.     }
  2347.  
  2348.     .dataframe tbody tr th {
  2349.         vertical-align: top;
  2350.     }
  2351.  
  2352.     .dataframe thead th {
  2353.         text-align: right;
  2354.     }
  2355. </style>
  2356. <table border="1" class="dataframe">
  2357.   <thead>
  2358.     <tr style="text-align: right;">
  2359.       <th>sdk</th>
  2360.       <th>1.3.9</th>
  2361.       <th>2.4.10</th>
  2362.       <th>2.4.8</th>
  2363.       <th>2.5.3</th>
  2364.       <th>2.5.5</th>
  2365.     </tr>
  2366.     <tr>
  2367.       <th>ad_unit_result</th>
  2368.       <th></th>
  2369.       <th></th>
  2370.       <th></th>
  2371.       <th></th>
  2372.       <th></th>
  2373.     </tr>
  2374.   </thead>
  2375.   <tbody>
  2376.     <tr>
  2377.       <th>0</th>
  2378.       <td>0</td>
  2379.       <td>60</td>
  2380.       <td>4</td>
  2381.       <td>287</td>
  2382.       <td>1</td>
  2383.     </tr>
  2384.     <tr>
  2385.       <th>1</th>
  2386.       <td>8</td>
  2387.       <td>29</td>
  2388.       <td>109</td>
  2389.       <td>7</td>
  2390.       <td>0</td>
  2391.     </tr>
  2392.     <tr>
  2393.       <th>2</th>
  2394.       <td>0</td>
  2395.       <td>0</td>
  2396.       <td>0</td>
  2397.       <td>378</td>
  2398.       <td>0</td>
  2399.     </tr>
  2400.   </tbody>
  2401. </table>
  2402. </div>
  2403.  
  2404.  
  2405.  
  2406.  
  2407. ```python
  2408. table = df_with_campaign.pivot_table(index='ifa', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  2409. table
  2410.  
  2411. ```
  2412.  
  2413.  
  2414.  
  2415.  
  2416. <div>
  2417. <style scoped>
  2418.     .dataframe tbody tr th:only-of-type {
  2419.         vertical-align: middle;
  2420.     }
  2421.  
  2422.     .dataframe tbody tr th {
  2423.         vertical-align: top;
  2424.     }
  2425.  
  2426.     .dataframe thead th {
  2427.         text-align: right;
  2428.     }
  2429. </style>
  2430. <table border="1" class="dataframe">
  2431.   <thead>
  2432.     <tr style="text-align: right;">
  2433.       <th>ad_unit_result</th>
  2434.       <th>0</th>
  2435.       <th>1</th>
  2436.       <th>2</th>
  2437.     </tr>
  2438.     <tr>
  2439.       <th>ifa</th>
  2440.       <th></th>
  2441.       <th></th>
  2442.       <th></th>
  2443.     </tr>
  2444.   </thead>
  2445.   <tbody>
  2446.     <tr>
  2447.       <th>00000000-0000-0000-0000-000000000000</th>
  2448.       <td>55</td>
  2449.       <td>3</td>
  2450.       <td>32</td>
  2451.     </tr>
  2452.     <tr>
  2453.       <th>008964C2-00A5-427C-A36D-162C8D2E1135</th>
  2454.       <td>0</td>
  2455.       <td>0</td>
  2456.       <td>1</td>
  2457.     </tr>
  2458.     <tr>
  2459.       <th>0158BB4D-F849-4D7B-89A8-224D5F9C9C11</th>
  2460.       <td>1</td>
  2461.       <td>0</td>
  2462.       <td>0</td>
  2463.     </tr>
  2464.     <tr>
  2465.       <th>01C7992E-F71F-417D-A012-DFDC60DAB8EC</th>
  2466.       <td>0</td>
  2467.       <td>0</td>
  2468.       <td>2</td>
  2469.     </tr>
  2470.     <tr>
  2471.       <th>0342E6C7-AEC5-4A94-AA64-4E7A52A6BAE6</th>
  2472.       <td>0</td>
  2473.       <td>0</td>
  2474.       <td>1</td>
  2475.     </tr>
  2476.     <tr>
  2477.       <th>04116686-F033-48D3-BF9D-A78004A5FF46</th>
  2478.       <td>0</td>
  2479.       <td>0</td>
  2480.       <td>1</td>
  2481.     </tr>
  2482.     <tr>
  2483.       <th>048CABD6-9DFC-418F-8ED0-BFCA2EAF8217</th>
  2484.       <td>0</td>
  2485.       <td>0</td>
  2486.       <td>1</td>
  2487.     </tr>
  2488.     <tr>
  2489.       <th>049C847D-42EA-430E-B53F-07C106923E43</th>
  2490.       <td>0</td>
  2491.       <td>0</td>
  2492.       <td>1</td>
  2493.     </tr>
  2494.     <tr>
  2495.       <th>0629889C-C74A-4F90-8B96-5B1B01AA1B5E</th>
  2496.       <td>0</td>
  2497.       <td>0</td>
  2498.       <td>1</td>
  2499.     </tr>
  2500.     <tr>
  2501.       <th>07ECCBA2-C208-4A6F-9AFA-A48DCB307B93</th>
  2502.       <td>1</td>
  2503.       <td>0</td>
  2504.       <td>0</td>
  2505.     </tr>
  2506.     <tr>
  2507.       <th>0B278CF6-99F3-4529-A3D8-D5E8756738D4</th>
  2508.       <td>3</td>
  2509.       <td>0</td>
  2510.       <td>3</td>
  2511.     </tr>
  2512.     <tr>
  2513.       <th>0C83D683-70E4-46F8-872A-1DD84AE57109</th>
  2514.       <td>0</td>
  2515.       <td>0</td>
  2516.       <td>1</td>
  2517.     </tr>
  2518.     <tr>
  2519.       <th>0D655420-9FC8-4C6C-BBA4-D257023B4D36</th>
  2520.       <td>0</td>
  2521.       <td>0</td>
  2522.       <td>1</td>
  2523.     </tr>
  2524.     <tr>
  2525.       <th>0E3100DC-A75A-41A0-BA99-3BE54D1F2332</th>
  2526.       <td>0</td>
  2527.       <td>0</td>
  2528.       <td>30</td>
  2529.     </tr>
  2530.     <tr>
  2531.       <th>0E68DB99-EE08-4F92-9277-5229842B2C47</th>
  2532.       <td>0</td>
  2533.       <td>0</td>
  2534.       <td>2</td>
  2535.     </tr>
  2536.     <tr>
  2537.       <th>0E6DA37D-C44D-4A52-A951-B7DEB790FDDF</th>
  2538.       <td>1</td>
  2539.       <td>0</td>
  2540.       <td>0</td>
  2541.     </tr>
  2542.     <tr>
  2543.       <th>11044462-2D45-417E-BCFD-6F95712990D2</th>
  2544.       <td>0</td>
  2545.       <td>0</td>
  2546.       <td>1</td>
  2547.     </tr>
  2548.     <tr>
  2549.       <th>115201B3-7ACB-4E8F-A59C-893413648A09</th>
  2550.       <td>1</td>
  2551.       <td>0</td>
  2552.       <td>1</td>
  2553.     </tr>
  2554.     <tr>
  2555.       <th>1226225B-0215-45E2-B067-07AEC9FD4413</th>
  2556.       <td>0</td>
  2557.       <td>0</td>
  2558.       <td>1</td>
  2559.     </tr>
  2560.     <tr>
  2561.       <th>1236CD27-09F7-4B88-8420-08B47D3EEC81</th>
  2562.       <td>0</td>
  2563.       <td>0</td>
  2564.       <td>1</td>
  2565.     </tr>
  2566.     <tr>
  2567.       <th>12441E21-3FBE-4FCA-BF7A-99E586D976BD</th>
  2568.       <td>0</td>
  2569.       <td>0</td>
  2570.       <td>3</td>
  2571.     </tr>
  2572.     <tr>
  2573.       <th>1446448F-7C88-40F0-89BD-643C7D739730</th>
  2574.       <td>0</td>
  2575.       <td>0</td>
  2576.       <td>1</td>
  2577.     </tr>
  2578.     <tr>
  2579.       <th>145A2286-1629-4EA8-BE27-45C0C7A51F5C</th>
  2580.       <td>0</td>
  2581.       <td>0</td>
  2582.       <td>1</td>
  2583.     </tr>
  2584.     <tr>
  2585.       <th>1794C7F9-8109-4504-9073-4828903B90D8</th>
  2586.       <td>0</td>
  2587.       <td>0</td>
  2588.       <td>1</td>
  2589.     </tr>
  2590.     <tr>
  2591.       <th>17B67A0D-AD66-4498-862D-B6B6FC6A1F0A</th>
  2592.       <td>0</td>
  2593.       <td>0</td>
  2594.       <td>1</td>
  2595.     </tr>
  2596.     <tr>
  2597.       <th>190F2D8F-F9A6-4B0B-A023-805DC2347B80</th>
  2598.       <td>0</td>
  2599.       <td>0</td>
  2600.       <td>2</td>
  2601.     </tr>
  2602.     <tr>
  2603.       <th>1A37FD9B-2E49-45D2-AEA8-7F2639B18198</th>
  2604.       <td>0</td>
  2605.       <td>0</td>
  2606.       <td>2</td>
  2607.     </tr>
  2608.     <tr>
  2609.       <th>1AFD4AAD-8BAF-436D-8FFE-CD5D34B0401B</th>
  2610.       <td>0</td>
  2611.       <td>0</td>
  2612.       <td>1</td>
  2613.     </tr>
  2614.     <tr>
  2615.       <th>1B0DED3A-CFD8-4B66-9ECC-5139B78C5C9E</th>
  2616.       <td>1</td>
  2617.       <td>0</td>
  2618.       <td>0</td>
  2619.     </tr>
  2620.     <tr>
  2621.       <th>1C267ECE-4071-4134-9FA8-F742393230BD</th>
  2622.       <td>0</td>
  2623.       <td>0</td>
  2624.       <td>4</td>
  2625.     </tr>
  2626.     <tr>
  2627.       <th>...</th>
  2628.       <td>...</td>
  2629.       <td>...</td>
  2630.       <td>...</td>
  2631.     </tr>
  2632.     <tr>
  2633.       <th>E61BE7C1-B54E-466A-B24F-C9DD533CC275</th>
  2634.       <td>0</td>
  2635.       <td>0</td>
  2636.       <td>1</td>
  2637.     </tr>
  2638.     <tr>
  2639.       <th>E6F8B06B-0BB8-41E0-9235-DA5A9871316A</th>
  2640.       <td>4</td>
  2641.       <td>0</td>
  2642.       <td>1</td>
  2643.     </tr>
  2644.     <tr>
  2645.       <th>E726822A-15EE-4388-9B06-1768B3C2F539</th>
  2646.       <td>0</td>
  2647.       <td>0</td>
  2648.       <td>1</td>
  2649.     </tr>
  2650.     <tr>
  2651.       <th>E7BDDF29-A660-415E-A06D-52345E79F6CF</th>
  2652.       <td>0</td>
  2653.       <td>0</td>
  2654.       <td>1</td>
  2655.     </tr>
  2656.     <tr>
  2657.       <th>E9CC2528-AA0F-4564-B0B3-CD20D0972849</th>
  2658.       <td>0</td>
  2659.       <td>0</td>
  2660.       <td>1</td>
  2661.     </tr>
  2662.     <tr>
  2663.       <th>E9D031EA-E223-4CDE-BCF3-E4B28076E51A</th>
  2664.       <td>0</td>
  2665.       <td>0</td>
  2666.       <td>1</td>
  2667.     </tr>
  2668.     <tr>
  2669.       <th>ED6A6C0A-E12D-4C36-A5C9-C420D2DBD77C</th>
  2670.       <td>0</td>
  2671.       <td>0</td>
  2672.       <td>1</td>
  2673.     </tr>
  2674.     <tr>
  2675.       <th>EE3E3CEA-832B-4F5A-9F0F-6BCF29655084</th>
  2676.       <td>0</td>
  2677.       <td>0</td>
  2678.       <td>1</td>
  2679.     </tr>
  2680.     <tr>
  2681.       <th>EEA2087C-8FFA-4A32-9909-A75F2C5891CE</th>
  2682.       <td>0</td>
  2683.       <td>1</td>
  2684.       <td>0</td>
  2685.     </tr>
  2686.     <tr>
  2687.       <th>EECB4502-287C-4944-AAAF-7B6CAD656560</th>
  2688.       <td>0</td>
  2689.       <td>0</td>
  2690.       <td>1</td>
  2691.     </tr>
  2692.     <tr>
  2693.       <th>EED15388-C1DF-42EC-95CC-1D90C6557A16</th>
  2694.       <td>0</td>
  2695.       <td>0</td>
  2696.       <td>1</td>
  2697.     </tr>
  2698.     <tr>
  2699.       <th>EFFD16F6-09EB-4A89-831D-3013E2C112C0</th>
  2700.       <td>1</td>
  2701.       <td>0</td>
  2702.       <td>0</td>
  2703.     </tr>
  2704.     <tr>
  2705.       <th>F0C826BF-21B6-4841-8662-4B27A740A026</th>
  2706.       <td>3</td>
  2707.       <td>0</td>
  2708.       <td>2</td>
  2709.     </tr>
  2710.     <tr>
  2711.       <th>F1769F20-0B16-4D66-BDC5-622816F54C7E</th>
  2712.       <td>0</td>
  2713.       <td>0</td>
  2714.       <td>1</td>
  2715.     </tr>
  2716.     <tr>
  2717.       <th>F1C66763-7C5A-4D4A-936D-5C73D3367B2C</th>
  2718.       <td>1</td>
  2719.       <td>0</td>
  2720.       <td>0</td>
  2721.     </tr>
  2722.     <tr>
  2723.       <th>F1CF3F63-B96F-4283-8B9A-6D8B114F5ECF</th>
  2724.       <td>0</td>
  2725.       <td>0</td>
  2726.       <td>1</td>
  2727.     </tr>
  2728.     <tr>
  2729.       <th>F2403DEF-62C5-4A58-9EDB-6CC72B2EAA34</th>
  2730.       <td>0</td>
  2731.       <td>0</td>
  2732.       <td>1</td>
  2733.     </tr>
  2734.     <tr>
  2735.       <th>F27E0EBF-1567-4542-8554-299A79C43EBF</th>
  2736.       <td>0</td>
  2737.       <td>0</td>
  2738.       <td>1</td>
  2739.     </tr>
  2740.     <tr>
  2741.       <th>F384D938-C2C1-4897-A03B-27D2E5F14546</th>
  2742.       <td>0</td>
  2743.       <td>0</td>
  2744.       <td>1</td>
  2745.     </tr>
  2746.     <tr>
  2747.       <th>F7427D7A-613B-4AB7-A59F-F9424AD48BCB</th>
  2748.       <td>0</td>
  2749.       <td>0</td>
  2750.       <td>1</td>
  2751.     </tr>
  2752.     <tr>
  2753.       <th>F81AF651-D2A8-4F5D-891F-AC6B37A460FF</th>
  2754.       <td>0</td>
  2755.       <td>0</td>
  2756.       <td>2</td>
  2757.     </tr>
  2758.     <tr>
  2759.       <th>F877DAF4-79CA-4F02-A195-ECBB318D338B</th>
  2760.       <td>0</td>
  2761.       <td>0</td>
  2762.       <td>1</td>
  2763.     </tr>
  2764.     <tr>
  2765.       <th>F88EA3B0-C5DC-4EDF-9410-D54EE9B840EE</th>
  2766.       <td>0</td>
  2767.       <td>0</td>
  2768.       <td>1</td>
  2769.     </tr>
  2770.     <tr>
  2771.       <th>F9D952D1-7FB3-47E4-94DC-985C713F6AE7</th>
  2772.       <td>1</td>
  2773.       <td>0</td>
  2774.       <td>0</td>
  2775.     </tr>
  2776.     <tr>
  2777.       <th>FA30EF84-1542-4EFB-80DF-E6076A012522</th>
  2778.       <td>0</td>
  2779.       <td>0</td>
  2780.       <td>1</td>
  2781.     </tr>
  2782.     <tr>
  2783.       <th>FC6C1005-F4CA-41ED-8B6F-45916A076EF5</th>
  2784.       <td>1</td>
  2785.       <td>0</td>
  2786.       <td>0</td>
  2787.     </tr>
  2788.     <tr>
  2789.       <th>FCE2E628-47C5-408C-A88C-4907CC62BCB7</th>
  2790.       <td>0</td>
  2791.       <td>0</td>
  2792.       <td>1</td>
  2793.     </tr>
  2794.     <tr>
  2795.       <th>FD963EC3-66A6-4635-A928-9EE966475CAB</th>
  2796.       <td>0</td>
  2797.       <td>0</td>
  2798.       <td>1</td>
  2799.     </tr>
  2800.     <tr>
  2801.       <th>FDF3FE7C-F7AA-4048-AD5D-7941D5797D6E</th>
  2802.       <td>3</td>
  2803.       <td>0</td>
  2804.       <td>1</td>
  2805.     </tr>
  2806.     <tr>
  2807.       <th>UNKNOWN</th>
  2808.       <td>64</td>
  2809.       <td>146</td>
  2810.       <td>0</td>
  2811.     </tr>
  2812.   </tbody>
  2813. </table>
  2814. <p>274 rows × 3 columns</p>
  2815. </div>
  2816.  
  2817.  
  2818.  
  2819.  
  2820. ```python
  2821. table["total"] = table[0] + table[2]
  2822. table[(table.total > table[0]) & (table.total > table[2])]
  2823. ```
  2824.  
  2825.  
  2826.  
  2827.  
  2828. <div>
  2829. <style scoped>
  2830.     .dataframe tbody tr th:only-of-type {
  2831.         vertical-align: middle;
  2832.     }
  2833.  
  2834.     .dataframe tbody tr th {
  2835.         vertical-align: top;
  2836.     }
  2837.  
  2838.     .dataframe thead th {
  2839.         text-align: right;
  2840.     }
  2841. </style>
  2842. <table border="1" class="dataframe">
  2843.   <thead>
  2844.     <tr style="text-align: right;">
  2845.       <th>ad_unit_result</th>
  2846.       <th>0</th>
  2847.       <th>1</th>
  2848.       <th>2</th>
  2849.       <th>total</th>
  2850.     </tr>
  2851.     <tr>
  2852.       <th>ifa</th>
  2853.       <th></th>
  2854.       <th></th>
  2855.       <th></th>
  2856.       <th></th>
  2857.     </tr>
  2858.   </thead>
  2859.   <tbody>
  2860.     <tr>
  2861.       <th>00000000-0000-0000-0000-000000000000</th>
  2862.       <td>55</td>
  2863.       <td>3</td>
  2864.       <td>32</td>
  2865.       <td>87</td>
  2866.     </tr>
  2867.     <tr>
  2868.       <th>0B278CF6-99F3-4529-A3D8-D5E8756738D4</th>
  2869.       <td>3</td>
  2870.       <td>0</td>
  2871.       <td>3</td>
  2872.       <td>6</td>
  2873.     </tr>
  2874.     <tr>
  2875.       <th>115201B3-7ACB-4E8F-A59C-893413648A09</th>
  2876.       <td>1</td>
  2877.       <td>0</td>
  2878.       <td>1</td>
  2879.       <td>2</td>
  2880.     </tr>
  2881.     <tr>
  2882.       <th>202FDD09-6C59-485A-9B82-748CCD318A0E</th>
  2883.       <td>1</td>
  2884.       <td>0</td>
  2885.       <td>1</td>
  2886.       <td>2</td>
  2887.     </tr>
  2888.     <tr>
  2889.       <th>205E5CD1-3845-4176-A948-62FF133C9418</th>
  2890.       <td>4</td>
  2891.       <td>0</td>
  2892.       <td>2</td>
  2893.       <td>6</td>
  2894.     </tr>
  2895.     <tr>
  2896.       <th>27DCDCB2-8E2A-46D8-82A6-FEC84EFA4E11</th>
  2897.       <td>1</td>
  2898.       <td>0</td>
  2899.       <td>5</td>
  2900.       <td>6</td>
  2901.     </tr>
  2902.     <tr>
  2903.       <th>2B12415D-A9DA-40F9-99CC-75EC7DEF1ABA</th>
  2904.       <td>8</td>
  2905.       <td>0</td>
  2906.       <td>2</td>
  2907.       <td>10</td>
  2908.     </tr>
  2909.     <tr>
  2910.       <th>33AEDEC7-B296-4604-B30F-E8273809D0CB</th>
  2911.       <td>1</td>
  2912.       <td>0</td>
  2913.       <td>1</td>
  2914.       <td>2</td>
  2915.     </tr>
  2916.     <tr>
  2917.       <th>389229BD-B34E-4921-A841-AC89945AF4ED</th>
  2918.       <td>1</td>
  2919.       <td>0</td>
  2920.       <td>2</td>
  2921.       <td>3</td>
  2922.     </tr>
  2923.     <tr>
  2924.       <th>3B5BBA4D-00F9-485F-9B6A-068E778AF9B7</th>
  2925.       <td>2</td>
  2926.       <td>0</td>
  2927.       <td>1</td>
  2928.       <td>3</td>
  2929.     </tr>
  2930.     <tr>
  2931.       <th>4B277F8C-0DEE-4B02-B69F-AD58F777D0AE</th>
  2932.       <td>1</td>
  2933.       <td>0</td>
  2934.       <td>1</td>
  2935.       <td>2</td>
  2936.     </tr>
  2937.     <tr>
  2938.       <th>62F61211-B7F1-4FFC-AFBA-0511A2206D0B</th>
  2939.       <td>1</td>
  2940.       <td>0</td>
  2941.       <td>4</td>
  2942.       <td>5</td>
  2943.     </tr>
  2944.     <tr>
  2945.       <th>852655AE-E696-4963-A217-FF8E47D2F26D</th>
  2946.       <td>13</td>
  2947.       <td>0</td>
  2948.       <td>7</td>
  2949.       <td>20</td>
  2950.     </tr>
  2951.     <tr>
  2952.       <th>8BF6B6D9-9418-4B3A-B2BE-F19272CE250A</th>
  2953.       <td>1</td>
  2954.       <td>0</td>
  2955.       <td>3</td>
  2956.       <td>4</td>
  2957.     </tr>
  2958.     <tr>
  2959.       <th>995BFC46-DABB-4A55-8302-63FE124EB32A</th>
  2960.       <td>1</td>
  2961.       <td>0</td>
  2962.       <td>7</td>
  2963.       <td>8</td>
  2964.     </tr>
  2965.     <tr>
  2966.       <th>9CE027AA-546D-4C70-85F4-D2755CAAAB05</th>
  2967.       <td>1</td>
  2968.       <td>0</td>
  2969.       <td>2</td>
  2970.       <td>3</td>
  2971.     </tr>
  2972.     <tr>
  2973.       <th>9EF2F84F-20AE-4B7F-BA0F-0B0163031576</th>
  2974.       <td>8</td>
  2975.       <td>0</td>
  2976.       <td>5</td>
  2977.       <td>13</td>
  2978.     </tr>
  2979.     <tr>
  2980.       <th>A747A96C-D8BA-47BB-ADEA-78768264789D</th>
  2981.       <td>4</td>
  2982.       <td>0</td>
  2983.       <td>1</td>
  2984.       <td>5</td>
  2985.     </tr>
  2986.     <tr>
  2987.       <th>ABFA3FD2-2CAE-4F50-A256-70D7DFC831B3</th>
  2988.       <td>27</td>
  2989.       <td>0</td>
  2990.       <td>2</td>
  2991.       <td>29</td>
  2992.     </tr>
  2993.     <tr>
  2994.       <th>B1C0D135-4CCD-4E21-94C0-62F390E5EE15</th>
  2995.       <td>1</td>
  2996.       <td>0</td>
  2997.       <td>1</td>
  2998.       <td>2</td>
  2999.     </tr>
  3000.     <tr>
  3001.       <th>BC83D7BD-F0DD-4A3A-867F-4617B9F16FA1</th>
  3002.       <td>1</td>
  3003.       <td>0</td>
  3004.       <td>1</td>
  3005.       <td>2</td>
  3006.     </tr>
  3007.     <tr>
  3008.       <th>BF8D52BA-8BF1-4DBF-96CA-51C3126981A7</th>
  3009.       <td>2</td>
  3010.       <td>0</td>
  3011.       <td>7</td>
  3012.       <td>9</td>
  3013.     </tr>
  3014.     <tr>
  3015.       <th>DBC4ACF1-4D3F-4657-8742-25773E854BBB</th>
  3016.       <td>3</td>
  3017.       <td>0</td>
  3018.       <td>4</td>
  3019.       <td>7</td>
  3020.     </tr>
  3021.     <tr>
  3022.       <th>DD6C206A-8C70-43CE-9265-8D59BA1FBD65</th>
  3023.       <td>1</td>
  3024.       <td>0</td>
  3025.       <td>1</td>
  3026.       <td>2</td>
  3027.     </tr>
  3028.     <tr>
  3029.       <th>E6F8B06B-0BB8-41E0-9235-DA5A9871316A</th>
  3030.       <td>4</td>
  3031.       <td>0</td>
  3032.       <td>1</td>
  3033.       <td>5</td>
  3034.     </tr>
  3035.     <tr>
  3036.       <th>F0C826BF-21B6-4841-8662-4B27A740A026</th>
  3037.       <td>3</td>
  3038.       <td>0</td>
  3039.       <td>2</td>
  3040.       <td>5</td>
  3041.     </tr>
  3042.     <tr>
  3043.       <th>FDF3FE7C-F7AA-4048-AD5D-7941D5797D6E</th>
  3044.       <td>3</td>
  3045.       <td>0</td>
  3046.       <td>1</td>
  3047.       <td>4</td>
  3048.     </tr>
  3049.   </tbody>
  3050. </table>
  3051. </div>
  3052.  
  3053.  
  3054.  
  3055.  
  3056. ```python
  3057. table[(table[2]!=0)]
  3058. ```
  3059.  
  3060.  
  3061.  
  3062.  
  3063. <div>
  3064. <style scoped>
  3065.     .dataframe tbody tr th:only-of-type {
  3066.         vertical-align: middle;
  3067.     }
  3068.  
  3069.     .dataframe tbody tr th {
  3070.         vertical-align: top;
  3071.     }
  3072.  
  3073.     .dataframe thead th {
  3074.         text-align: right;
  3075.     }
  3076. </style>
  3077. <table border="1" class="dataframe">
  3078.   <thead>
  3079.     <tr style="text-align: right;">
  3080.       <th>ad_unit_result</th>
  3081.       <th>0</th>
  3082.       <th>1</th>
  3083.       <th>2</th>
  3084.       <th>total</th>
  3085.     </tr>
  3086.     <tr>
  3087.       <th>ifa</th>
  3088.       <th></th>
  3089.       <th></th>
  3090.       <th></th>
  3091.       <th></th>
  3092.     </tr>
  3093.   </thead>
  3094.   <tbody>
  3095.     <tr>
  3096.       <th>00000000-0000-0000-0000-000000000000</th>
  3097.       <td>55</td>
  3098.       <td>3</td>
  3099.       <td>32</td>
  3100.       <td>87</td>
  3101.     </tr>
  3102.     <tr>
  3103.       <th>008964C2-00A5-427C-A36D-162C8D2E1135</th>
  3104.       <td>0</td>
  3105.       <td>0</td>
  3106.       <td>1</td>
  3107.       <td>1</td>
  3108.     </tr>
  3109.     <tr>
  3110.       <th>01C7992E-F71F-417D-A012-DFDC60DAB8EC</th>
  3111.       <td>0</td>
  3112.       <td>0</td>
  3113.       <td>2</td>
  3114.       <td>2</td>
  3115.     </tr>
  3116.     <tr>
  3117.       <th>0342E6C7-AEC5-4A94-AA64-4E7A52A6BAE6</th>
  3118.       <td>0</td>
  3119.       <td>0</td>
  3120.       <td>1</td>
  3121.       <td>1</td>
  3122.     </tr>
  3123.     <tr>
  3124.       <th>04116686-F033-48D3-BF9D-A78004A5FF46</th>
  3125.       <td>0</td>
  3126.       <td>0</td>
  3127.       <td>1</td>
  3128.       <td>1</td>
  3129.     </tr>
  3130.     <tr>
  3131.       <th>048CABD6-9DFC-418F-8ED0-BFCA2EAF8217</th>
  3132.       <td>0</td>
  3133.       <td>0</td>
  3134.       <td>1</td>
  3135.       <td>1</td>
  3136.     </tr>
  3137.     <tr>
  3138.       <th>049C847D-42EA-430E-B53F-07C106923E43</th>
  3139.       <td>0</td>
  3140.       <td>0</td>
  3141.       <td>1</td>
  3142.       <td>1</td>
  3143.     </tr>
  3144.     <tr>
  3145.       <th>0629889C-C74A-4F90-8B96-5B1B01AA1B5E</th>
  3146.       <td>0</td>
  3147.       <td>0</td>
  3148.       <td>1</td>
  3149.       <td>1</td>
  3150.     </tr>
  3151.     <tr>
  3152.       <th>0B278CF6-99F3-4529-A3D8-D5E8756738D4</th>
  3153.       <td>3</td>
  3154.       <td>0</td>
  3155.       <td>3</td>
  3156.       <td>6</td>
  3157.     </tr>
  3158.     <tr>
  3159.       <th>0C83D683-70E4-46F8-872A-1DD84AE57109</th>
  3160.       <td>0</td>
  3161.       <td>0</td>
  3162.       <td>1</td>
  3163.       <td>1</td>
  3164.     </tr>
  3165.     <tr>
  3166.       <th>0D655420-9FC8-4C6C-BBA4-D257023B4D36</th>
  3167.       <td>0</td>
  3168.       <td>0</td>
  3169.       <td>1</td>
  3170.       <td>1</td>
  3171.     </tr>
  3172.     <tr>
  3173.       <th>0E3100DC-A75A-41A0-BA99-3BE54D1F2332</th>
  3174.       <td>0</td>
  3175.       <td>0</td>
  3176.       <td>30</td>
  3177.       <td>30</td>
  3178.     </tr>
  3179.     <tr>
  3180.       <th>0E68DB99-EE08-4F92-9277-5229842B2C47</th>
  3181.       <td>0</td>
  3182.       <td>0</td>
  3183.       <td>2</td>
  3184.       <td>2</td>
  3185.     </tr>
  3186.     <tr>
  3187.       <th>11044462-2D45-417E-BCFD-6F95712990D2</th>
  3188.       <td>0</td>
  3189.       <td>0</td>
  3190.       <td>1</td>
  3191.       <td>1</td>
  3192.     </tr>
  3193.     <tr>
  3194.       <th>115201B3-7ACB-4E8F-A59C-893413648A09</th>
  3195.       <td>1</td>
  3196.       <td>0</td>
  3197.       <td>1</td>
  3198.       <td>2</td>
  3199.     </tr>
  3200.     <tr>
  3201.       <th>1226225B-0215-45E2-B067-07AEC9FD4413</th>
  3202.       <td>0</td>
  3203.       <td>0</td>
  3204.       <td>1</td>
  3205.       <td>1</td>
  3206.     </tr>
  3207.     <tr>
  3208.       <th>1236CD27-09F7-4B88-8420-08B47D3EEC81</th>
  3209.       <td>0</td>
  3210.       <td>0</td>
  3211.       <td>1</td>
  3212.       <td>1</td>
  3213.     </tr>
  3214.     <tr>
  3215.       <th>12441E21-3FBE-4FCA-BF7A-99E586D976BD</th>
  3216.       <td>0</td>
  3217.       <td>0</td>
  3218.       <td>3</td>
  3219.       <td>3</td>
  3220.     </tr>
  3221.     <tr>
  3222.       <th>1446448F-7C88-40F0-89BD-643C7D739730</th>
  3223.       <td>0</td>
  3224.       <td>0</td>
  3225.       <td>1</td>
  3226.       <td>1</td>
  3227.     </tr>
  3228.     <tr>
  3229.       <th>145A2286-1629-4EA8-BE27-45C0C7A51F5C</th>
  3230.       <td>0</td>
  3231.       <td>0</td>
  3232.       <td>1</td>
  3233.       <td>1</td>
  3234.     </tr>
  3235.     <tr>
  3236.       <th>1794C7F9-8109-4504-9073-4828903B90D8</th>
  3237.       <td>0</td>
  3238.       <td>0</td>
  3239.       <td>1</td>
  3240.       <td>1</td>
  3241.     </tr>
  3242.     <tr>
  3243.       <th>17B67A0D-AD66-4498-862D-B6B6FC6A1F0A</th>
  3244.       <td>0</td>
  3245.       <td>0</td>
  3246.       <td>1</td>
  3247.       <td>1</td>
  3248.     </tr>
  3249.     <tr>
  3250.       <th>190F2D8F-F9A6-4B0B-A023-805DC2347B80</th>
  3251.       <td>0</td>
  3252.       <td>0</td>
  3253.       <td>2</td>
  3254.       <td>2</td>
  3255.     </tr>
  3256.     <tr>
  3257.       <th>1A37FD9B-2E49-45D2-AEA8-7F2639B18198</th>
  3258.       <td>0</td>
  3259.       <td>0</td>
  3260.       <td>2</td>
  3261.       <td>2</td>
  3262.     </tr>
  3263.     <tr>
  3264.       <th>1AFD4AAD-8BAF-436D-8FFE-CD5D34B0401B</th>
  3265.       <td>0</td>
  3266.       <td>0</td>
  3267.       <td>1</td>
  3268.       <td>1</td>
  3269.     </tr>
  3270.     <tr>
  3271.       <th>1C267ECE-4071-4134-9FA8-F742393230BD</th>
  3272.       <td>0</td>
  3273.       <td>0</td>
  3274.       <td>4</td>
  3275.       <td>4</td>
  3276.     </tr>
  3277.     <tr>
  3278.       <th>1C382FD8-B909-485B-8427-DFE04E9ED4EA</th>
  3279.       <td>0</td>
  3280.       <td>0</td>
  3281.       <td>1</td>
  3282.       <td>1</td>
  3283.     </tr>
  3284.     <tr>
  3285.       <th>1C57BF38-2950-411E-BB2C-F9EAF97AACE4</th>
  3286.       <td>0</td>
  3287.       <td>0</td>
  3288.       <td>2</td>
  3289.       <td>2</td>
  3290.     </tr>
  3291.     <tr>
  3292.       <th>1D3091A5-3991-4237-8495-A8DFB5837721</th>
  3293.       <td>0</td>
  3294.       <td>0</td>
  3295.       <td>1</td>
  3296.       <td>1</td>
  3297.     </tr>
  3298.     <tr>
  3299.       <th>1D35A7CA-0620-4C9D-B5C9-386F9B1968D0</th>
  3300.       <td>0</td>
  3301.       <td>0</td>
  3302.       <td>1</td>
  3303.       <td>1</td>
  3304.     </tr>
  3305.     <tr>
  3306.       <th>...</th>
  3307.       <td>...</td>
  3308.       <td>...</td>
  3309.       <td>...</td>
  3310.       <td>...</td>
  3311.     </tr>
  3312.     <tr>
  3313.       <th>DBC4ACF1-4D3F-4657-8742-25773E854BBB</th>
  3314.       <td>3</td>
  3315.       <td>0</td>
  3316.       <td>4</td>
  3317.       <td>7</td>
  3318.     </tr>
  3319.     <tr>
  3320.       <th>DD6C206A-8C70-43CE-9265-8D59BA1FBD65</th>
  3321.       <td>1</td>
  3322.       <td>0</td>
  3323.       <td>1</td>
  3324.       <td>2</td>
  3325.     </tr>
  3326.     <tr>
  3327.       <th>DDD73031-0567-4739-9CD2-5551FE338E5A</th>
  3328.       <td>0</td>
  3329.       <td>0</td>
  3330.       <td>1</td>
  3331.       <td>1</td>
  3332.     </tr>
  3333.     <tr>
  3334.       <th>E0D0AC80-4603-4901-8C30-BB13F568345A</th>
  3335.       <td>0</td>
  3336.       <td>0</td>
  3337.       <td>1</td>
  3338.       <td>1</td>
  3339.     </tr>
  3340.     <tr>
  3341.       <th>E2DC2B77-C175-48F4-A378-013E8B31B1BB</th>
  3342.       <td>0</td>
  3343.       <td>0</td>
  3344.       <td>1</td>
  3345.       <td>1</td>
  3346.     </tr>
  3347.     <tr>
  3348.       <th>E417CC90-FE36-48C9-9170-0C5A41379D42</th>
  3349.       <td>0</td>
  3350.       <td>0</td>
  3351.       <td>1</td>
  3352.       <td>1</td>
  3353.     </tr>
  3354.     <tr>
  3355.       <th>E61BE7C1-B54E-466A-B24F-C9DD533CC275</th>
  3356.       <td>0</td>
  3357.       <td>0</td>
  3358.       <td>1</td>
  3359.       <td>1</td>
  3360.     </tr>
  3361.     <tr>
  3362.       <th>E6F8B06B-0BB8-41E0-9235-DA5A9871316A</th>
  3363.       <td>4</td>
  3364.       <td>0</td>
  3365.       <td>1</td>
  3366.       <td>5</td>
  3367.     </tr>
  3368.     <tr>
  3369.       <th>E726822A-15EE-4388-9B06-1768B3C2F539</th>
  3370.       <td>0</td>
  3371.       <td>0</td>
  3372.       <td>1</td>
  3373.       <td>1</td>
  3374.     </tr>
  3375.     <tr>
  3376.       <th>E7BDDF29-A660-415E-A06D-52345E79F6CF</th>
  3377.       <td>0</td>
  3378.       <td>0</td>
  3379.       <td>1</td>
  3380.       <td>1</td>
  3381.     </tr>
  3382.     <tr>
  3383.       <th>E9CC2528-AA0F-4564-B0B3-CD20D0972849</th>
  3384.       <td>0</td>
  3385.       <td>0</td>
  3386.       <td>1</td>
  3387.       <td>1</td>
  3388.     </tr>
  3389.     <tr>
  3390.       <th>E9D031EA-E223-4CDE-BCF3-E4B28076E51A</th>
  3391.       <td>0</td>
  3392.       <td>0</td>
  3393.       <td>1</td>
  3394.       <td>1</td>
  3395.     </tr>
  3396.     <tr>
  3397.       <th>ED6A6C0A-E12D-4C36-A5C9-C420D2DBD77C</th>
  3398.       <td>0</td>
  3399.       <td>0</td>
  3400.       <td>1</td>
  3401.       <td>1</td>
  3402.     </tr>
  3403.     <tr>
  3404.       <th>EE3E3CEA-832B-4F5A-9F0F-6BCF29655084</th>
  3405.       <td>0</td>
  3406.       <td>0</td>
  3407.       <td>1</td>
  3408.       <td>1</td>
  3409.     </tr>
  3410.     <tr>
  3411.       <th>EECB4502-287C-4944-AAAF-7B6CAD656560</th>
  3412.       <td>0</td>
  3413.       <td>0</td>
  3414.       <td>1</td>
  3415.       <td>1</td>
  3416.     </tr>
  3417.     <tr>
  3418.       <th>EED15388-C1DF-42EC-95CC-1D90C6557A16</th>
  3419.       <td>0</td>
  3420.       <td>0</td>
  3421.       <td>1</td>
  3422.       <td>1</td>
  3423.     </tr>
  3424.     <tr>
  3425.       <th>F0C826BF-21B6-4841-8662-4B27A740A026</th>
  3426.       <td>3</td>
  3427.       <td>0</td>
  3428.       <td>2</td>
  3429.       <td>5</td>
  3430.     </tr>
  3431.     <tr>
  3432.       <th>F1769F20-0B16-4D66-BDC5-622816F54C7E</th>
  3433.       <td>0</td>
  3434.       <td>0</td>
  3435.       <td>1</td>
  3436.       <td>1</td>
  3437.     </tr>
  3438.     <tr>
  3439.       <th>F1CF3F63-B96F-4283-8B9A-6D8B114F5ECF</th>
  3440.       <td>0</td>
  3441.       <td>0</td>
  3442.       <td>1</td>
  3443.       <td>1</td>
  3444.     </tr>
  3445.     <tr>
  3446.       <th>F2403DEF-62C5-4A58-9EDB-6CC72B2EAA34</th>
  3447.       <td>0</td>
  3448.       <td>0</td>
  3449.       <td>1</td>
  3450.       <td>1</td>
  3451.     </tr>
  3452.     <tr>
  3453.       <th>F27E0EBF-1567-4542-8554-299A79C43EBF</th>
  3454.       <td>0</td>
  3455.       <td>0</td>
  3456.       <td>1</td>
  3457.       <td>1</td>
  3458.     </tr>
  3459.     <tr>
  3460.       <th>F384D938-C2C1-4897-A03B-27D2E5F14546</th>
  3461.       <td>0</td>
  3462.       <td>0</td>
  3463.       <td>1</td>
  3464.       <td>1</td>
  3465.     </tr>
  3466.     <tr>
  3467.       <th>F7427D7A-613B-4AB7-A59F-F9424AD48BCB</th>
  3468.       <td>0</td>
  3469.       <td>0</td>
  3470.       <td>1</td>
  3471.       <td>1</td>
  3472.     </tr>
  3473.     <tr>
  3474.       <th>F81AF651-D2A8-4F5D-891F-AC6B37A460FF</th>
  3475.       <td>0</td>
  3476.       <td>0</td>
  3477.       <td>2</td>
  3478.       <td>2</td>
  3479.     </tr>
  3480.     <tr>
  3481.       <th>F877DAF4-79CA-4F02-A195-ECBB318D338B</th>
  3482.       <td>0</td>
  3483.       <td>0</td>
  3484.       <td>1</td>
  3485.       <td>1</td>
  3486.     </tr>
  3487.     <tr>
  3488.       <th>F88EA3B0-C5DC-4EDF-9410-D54EE9B840EE</th>
  3489.       <td>0</td>
  3490.       <td>0</td>
  3491.       <td>1</td>
  3492.       <td>1</td>
  3493.     </tr>
  3494.     <tr>
  3495.       <th>FA30EF84-1542-4EFB-80DF-E6076A012522</th>
  3496.       <td>0</td>
  3497.       <td>0</td>
  3498.       <td>1</td>
  3499.       <td>1</td>
  3500.     </tr>
  3501.     <tr>
  3502.       <th>FCE2E628-47C5-408C-A88C-4907CC62BCB7</th>
  3503.       <td>0</td>
  3504.       <td>0</td>
  3505.       <td>1</td>
  3506.       <td>1</td>
  3507.     </tr>
  3508.     <tr>
  3509.       <th>FD963EC3-66A6-4635-A928-9EE966475CAB</th>
  3510.       <td>0</td>
  3511.       <td>0</td>
  3512.       <td>1</td>
  3513.       <td>1</td>
  3514.     </tr>
  3515.     <tr>
  3516.       <th>FDF3FE7C-F7AA-4048-AD5D-7941D5797D6E</th>
  3517.       <td>3</td>
  3518.       <td>0</td>
  3519.       <td>1</td>
  3520.       <td>4</td>
  3521.     </tr>
  3522.   </tbody>
  3523. </table>
  3524. <p>207 rows × 4 columns</p>
  3525. </div>
  3526.  
  3527.  
  3528.  
  3529.  
  3530. ```python
  3531. table = df_with_campaign.pivot_table(index='osv', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  3532. table
  3533.  
  3534. ```
  3535.  
  3536.  
  3537.  
  3538.  
  3539. <div>
  3540. <style scoped>
  3541.     .dataframe tbody tr th:only-of-type {
  3542.         vertical-align: middle;
  3543.     }
  3544.  
  3545.     .dataframe tbody tr th {
  3546.         vertical-align: top;
  3547.     }
  3548.  
  3549.     .dataframe thead th {
  3550.         text-align: right;
  3551.     }
  3552. </style>
  3553. <table border="1" class="dataframe">
  3554.   <thead>
  3555.     <tr style="text-align: right;">
  3556.       <th>ad_unit_result</th>
  3557.       <th>0</th>
  3558.       <th>1</th>
  3559.       <th>2</th>
  3560.     </tr>
  3561.     <tr>
  3562.       <th>osv</th>
  3563.       <th></th>
  3564.       <th></th>
  3565.       <th></th>
  3566.     </tr>
  3567.   </thead>
  3568.   <tbody>
  3569.     <tr>
  3570.       <th>10.0.2</th>
  3571.       <td>0</td>
  3572.       <td>0</td>
  3573.       <td>1</td>
  3574.     </tr>
  3575.     <tr>
  3576.       <th>10.2</th>
  3577.       <td>0</td>
  3578.       <td>0</td>
  3579.       <td>1</td>
  3580.     </tr>
  3581.     <tr>
  3582.       <th>10.3.2</th>
  3583.       <td>0</td>
  3584.       <td>0</td>
  3585.       <td>2</td>
  3586.     </tr>
  3587.     <tr>
  3588.       <th>10.3.3</th>
  3589.       <td>15</td>
  3590.       <td>0</td>
  3591.       <td>6</td>
  3592.     </tr>
  3593.     <tr>
  3594.       <th>11.0.1</th>
  3595.       <td>0</td>
  3596.       <td>0</td>
  3597.       <td>3</td>
  3598.     </tr>
  3599.     <tr>
  3600.       <th>11.2.1</th>
  3601.       <td>17</td>
  3602.       <td>0</td>
  3603.       <td>0</td>
  3604.     </tr>
  3605.     <tr>
  3606.       <th>11.2.2</th>
  3607.       <td>1</td>
  3608.       <td>0</td>
  3609.       <td>0</td>
  3610.     </tr>
  3611.     <tr>
  3612.       <th>11.2.5</th>
  3613.       <td>0</td>
  3614.       <td>0</td>
  3615.       <td>1</td>
  3616.     </tr>
  3617.     <tr>
  3618.       <th>11.2.6</th>
  3619.       <td>0</td>
  3620.       <td>0</td>
  3621.       <td>2</td>
  3622.     </tr>
  3623.     <tr>
  3624.       <th>11.3</th>
  3625.       <td>0</td>
  3626.       <td>0</td>
  3627.       <td>1</td>
  3628.     </tr>
  3629.     <tr>
  3630.       <th>11.4.1</th>
  3631.       <td>5</td>
  3632.       <td>0</td>
  3633.       <td>22</td>
  3634.     </tr>
  3635.     <tr>
  3636.       <th>12.0.1</th>
  3637.       <td>1</td>
  3638.       <td>0</td>
  3639.       <td>4</td>
  3640.     </tr>
  3641.     <tr>
  3642.       <th>12.1</th>
  3643.       <td>6</td>
  3644.       <td>0</td>
  3645.       <td>3</td>
  3646.     </tr>
  3647.     <tr>
  3648.       <th>12.1.1</th>
  3649.       <td>0</td>
  3650.       <td>2</td>
  3651.       <td>1</td>
  3652.     </tr>
  3653.     <tr>
  3654.       <th>12.1.2</th>
  3655.       <td>15</td>
  3656.       <td>0</td>
  3657.       <td>9</td>
  3658.     </tr>
  3659.     <tr>
  3660.       <th>12.1.3</th>
  3661.       <td>1</td>
  3662.       <td>0</td>
  3663.       <td>4</td>
  3664.     </tr>
  3665.     <tr>
  3666.       <th>12.1.4</th>
  3667.       <td>17</td>
  3668.       <td>0</td>
  3669.       <td>23</td>
  3670.     </tr>
  3671.     <tr>
  3672.       <th>12.2</th>
  3673.       <td>19</td>
  3674.       <td>2</td>
  3675.       <td>19</td>
  3676.     </tr>
  3677.     <tr>
  3678.       <th>12.3</th>
  3679.       <td>3</td>
  3680.       <td>0</td>
  3681.       <td>8</td>
  3682.     </tr>
  3683.     <tr>
  3684.       <th>12.3.1</th>
  3685.       <td>155</td>
  3686.       <td>1</td>
  3687.       <td>157</td>
  3688.     </tr>
  3689.     <tr>
  3690.       <th>12.3.2</th>
  3691.       <td>3</td>
  3692.       <td>1</td>
  3693.       <td>16</td>
  3694.     </tr>
  3695.     <tr>
  3696.       <th>9.3.2</th>
  3697.       <td>8</td>
  3698.       <td>0</td>
  3699.       <td>2</td>
  3700.     </tr>
  3701.     <tr>
  3702.       <th>9.3.4</th>
  3703.       <td>0</td>
  3704.       <td>0</td>
  3705.       <td>1</td>
  3706.     </tr>
  3707.     <tr>
  3708.       <th>9.3.5</th>
  3709.       <td>22</td>
  3710.       <td>1</td>
  3711.       <td>92</td>
  3712.     </tr>
  3713.     <tr>
  3714.       <th>UNKNOWN</th>
  3715.       <td>64</td>
  3716.       <td>146</td>
  3717.       <td>0</td>
  3718.     </tr>
  3719.   </tbody>
  3720. </table>
  3721. </div>
  3722.  
  3723.  
  3724.  
  3725.  
  3726. ```python
  3727. table = df_with_campaign.pivot_table(index='connectiontype', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  3728. table
  3729.  
  3730. ```
  3731.  
  3732.  
  3733.  
  3734.  
  3735. <div>
  3736. <style scoped>
  3737.     .dataframe tbody tr th:only-of-type {
  3738.         vertical-align: middle;
  3739.     }
  3740.  
  3741.     .dataframe tbody tr th {
  3742.         vertical-align: top;
  3743.     }
  3744.  
  3745.     .dataframe thead th {
  3746.         text-align: right;
  3747.     }
  3748. </style>
  3749. <table border="1" class="dataframe">
  3750.   <thead>
  3751.     <tr style="text-align: right;">
  3752.       <th>ad_unit_result</th>
  3753.       <th>0</th>
  3754.       <th>1</th>
  3755.       <th>2</th>
  3756.     </tr>
  3757.     <tr>
  3758.       <th>connectiontype</th>
  3759.       <th></th>
  3760.       <th></th>
  3761.       <th></th>
  3762.     </tr>
  3763.   </thead>
  3764.   <tbody>
  3765.     <tr>
  3766.       <th>-1</th>
  3767.       <td>85</td>
  3768.       <td>149</td>
  3769.       <td>19</td>
  3770.     </tr>
  3771.     <tr>
  3772.       <th>2</th>
  3773.       <td>228</td>
  3774.       <td>4</td>
  3775.       <td>232</td>
  3776.     </tr>
  3777.     <tr>
  3778.       <th>4</th>
  3779.       <td>0</td>
  3780.       <td>0</td>
  3781.       <td>6</td>
  3782.     </tr>
  3783.     <tr>
  3784.       <th>5</th>
  3785.       <td>11</td>
  3786.       <td>0</td>
  3787.       <td>37</td>
  3788.     </tr>
  3789.     <tr>
  3790.       <th>6</th>
  3791.       <td>28</td>
  3792.       <td>0</td>
  3793.       <td>84</td>
  3794.     </tr>
  3795.   </tbody>
  3796. </table>
  3797. </div>
  3798.  
  3799.  
  3800.  
  3801.  
  3802. ```python
  3803. table = df_with_campaign_failed.pivot_table(index='model', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  3804. table
  3805.  
  3806. ```
  3807.  
  3808.  
  3809.  
  3810.  
  3811. <div>
  3812. <style scoped>
  3813.     .dataframe tbody tr th:only-of-type {
  3814.         vertical-align: middle;
  3815.     }
  3816.  
  3817.     .dataframe tbody tr th {
  3818.         vertical-align: top;
  3819.     }
  3820.  
  3821.     .dataframe thead th {
  3822.         text-align: right;
  3823.     }
  3824. </style>
  3825. <table border="1" class="dataframe">
  3826.   <thead>
  3827.     <tr style="text-align: right;">
  3828.       <th>ad_unit_result</th>
  3829.       <th>1</th>
  3830.       <th>2</th>
  3831.     </tr>
  3832.     <tr>
  3833.       <th>model</th>
  3834.       <th></th>
  3835.       <th></th>
  3836.     </tr>
  3837.   </thead>
  3838.   <tbody>
  3839.     <tr>
  3840.       <th>UNKNOWN</th>
  3841.       <td>146</td>
  3842.       <td>0</td>
  3843.     </tr>
  3844.     <tr>
  3845.       <th>iPad2,1</th>
  3846.       <td>0</td>
  3847.       <td>5</td>
  3848.     </tr>
  3849.     <tr>
  3850.       <th>iPad2,2</th>
  3851.       <td>0</td>
  3852.       <td>3</td>
  3853.     </tr>
  3854.     <tr>
  3855.       <th>iPad2,4</th>
  3856.       <td>0</td>
  3857.       <td>12</td>
  3858.     </tr>
  3859.     <tr>
  3860.       <th>iPad2,5</th>
  3861.       <td>1</td>
  3862.       <td>31</td>
  3863.     </tr>
  3864.     <tr>
  3865.       <th>iPad2,7</th>
  3866.       <td>0</td>
  3867.       <td>32</td>
  3868.     </tr>
  3869.     <tr>
  3870.       <th>iPad3,1</th>
  3871.       <td>0</td>
  3872.       <td>1</td>
  3873.     </tr>
  3874.     <tr>
  3875.       <th>iPad3,3</th>
  3876.       <td>0</td>
  3877.       <td>3</td>
  3878.     </tr>
  3879.     <tr>
  3880.       <th>iPad3,4</th>
  3881.       <td>0</td>
  3882.       <td>2</td>
  3883.     </tr>
  3884.     <tr>
  3885.       <th>iPad4,1</th>
  3886.       <td>0</td>
  3887.       <td>4</td>
  3888.     </tr>
  3889.     <tr>
  3890.       <th>iPad4,2</th>
  3891.       <td>0</td>
  3892.       <td>3</td>
  3893.     </tr>
  3894.     <tr>
  3895.       <th>iPad4,4</th>
  3896.       <td>2</td>
  3897.       <td>4</td>
  3898.     </tr>
  3899.     <tr>
  3900.       <th>iPad4,5</th>
  3901.       <td>0</td>
  3902.       <td>1</td>
  3903.     </tr>
  3904.     <tr>
  3905.       <th>iPad5,2</th>
  3906.       <td>0</td>
  3907.       <td>2</td>
  3908.     </tr>
  3909.     <tr>
  3910.       <th>iPad5,3</th>
  3911.       <td>0</td>
  3912.       <td>10</td>
  3913.     </tr>
  3914.     <tr>
  3915.       <th>iPad5,4</th>
  3916.       <td>0</td>
  3917.       <td>1</td>
  3918.     </tr>
  3919.     <tr>
  3920.       <th>iPad6,11</th>
  3921.       <td>0</td>
  3922.       <td>4</td>
  3923.     </tr>
  3924.     <tr>
  3925.       <th>iPad6,12</th>
  3926.       <td>1</td>
  3927.       <td>0</td>
  3928.     </tr>
  3929.     <tr>
  3930.       <th>iPad6,7</th>
  3931.       <td>0</td>
  3932.       <td>1</td>
  3933.     </tr>
  3934.     <tr>
  3935.       <th>iPad7,1</th>
  3936.       <td>0</td>
  3937.       <td>1</td>
  3938.     </tr>
  3939.     <tr>
  3940.       <th>iPad7,4</th>
  3941.       <td>0</td>
  3942.       <td>2</td>
  3943.     </tr>
  3944.     <tr>
  3945.       <th>iPad7,5</th>
  3946.       <td>0</td>
  3947.       <td>23</td>
  3948.     </tr>
  3949.     <tr>
  3950.       <th>iPhone10,1</th>
  3951.       <td>0</td>
  3952.       <td>8</td>
  3953.     </tr>
  3954.     <tr>
  3955.       <th>iPhone10,2</th>
  3956.       <td>1</td>
  3957.       <td>8</td>
  3958.     </tr>
  3959.     <tr>
  3960.       <th>iPhone10,4</th>
  3961.       <td>0</td>
  3962.       <td>9</td>
  3963.     </tr>
  3964.     <tr>
  3965.       <th>iPhone10,5</th>
  3966.       <td>0</td>
  3967.       <td>19</td>
  3968.     </tr>
  3969.     <tr>
  3970.       <th>iPhone10,6</th>
  3971.       <td>0</td>
  3972.       <td>7</td>
  3973.     </tr>
  3974.     <tr>
  3975.       <th>iPhone11,2</th>
  3976.       <td>0</td>
  3977.       <td>4</td>
  3978.     </tr>
  3979.     <tr>
  3980.       <th>iPhone11,6</th>
  3981.       <td>2</td>
  3982.       <td>8</td>
  3983.     </tr>
  3984.     <tr>
  3985.       <th>iPhone11,8</th>
  3986.       <td>0</td>
  3987.       <td>20</td>
  3988.     </tr>
  3989.     <tr>
  3990.       <th>iPhone4,1</th>
  3991.       <td>0</td>
  3992.       <td>3</td>
  3993.     </tr>
  3994.     <tr>
  3995.       <th>iPhone5,3</th>
  3996.       <td>0</td>
  3997.       <td>1</td>
  3998.     </tr>
  3999.     <tr>
  4000.       <th>iPhone5,4</th>
  4001.       <td>0</td>
  4002.       <td>1</td>
  4003.     </tr>
  4004.     <tr>
  4005.       <th>iPhone6,1</th>
  4006.       <td>0</td>
  4007.       <td>7</td>
  4008.     </tr>
  4009.     <tr>
  4010.       <th>iPhone6,2</th>
  4011.       <td>0</td>
  4012.       <td>4</td>
  4013.     </tr>
  4014.     <tr>
  4015.       <th>iPhone7,1</th>
  4016.       <td>0</td>
  4017.       <td>21</td>
  4018.     </tr>
  4019.     <tr>
  4020.       <th>iPhone7,2</th>
  4021.       <td>0</td>
  4022.       <td>23</td>
  4023.     </tr>
  4024.     <tr>
  4025.       <th>iPhone8,1</th>
  4026.       <td>0</td>
  4027.       <td>19</td>
  4028.     </tr>
  4029.     <tr>
  4030.       <th>iPhone8,2</th>
  4031.       <td>0</td>
  4032.       <td>9</td>
  4033.     </tr>
  4034.     <tr>
  4035.       <th>iPhone8,4</th>
  4036.       <td>0</td>
  4037.       <td>7</td>
  4038.     </tr>
  4039.     <tr>
  4040.       <th>iPhone9,1</th>
  4041.       <td>0</td>
  4042.       <td>7</td>
  4043.     </tr>
  4044.     <tr>
  4045.       <th>iPhone9,2</th>
  4046.       <td>0</td>
  4047.       <td>17</td>
  4048.     </tr>
  4049.     <tr>
  4050.       <th>iPhone9,3</th>
  4051.       <td>0</td>
  4052.       <td>22</td>
  4053.     </tr>
  4054.     <tr>
  4055.       <th>iPhone9,4</th>
  4056.       <td>0</td>
  4057.       <td>7</td>
  4058.     </tr>
  4059.     <tr>
  4060.       <th>iPod5,1</th>
  4061.       <td>0</td>
  4062.       <td>2</td>
  4063.     </tr>
  4064.   </tbody>
  4065. </table>
  4066. </div>
  4067.  
  4068.  
  4069.  
  4070.  
  4071. ```python
  4072. table = df_with_campaign.pivot_table(index='lmt', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  4073. table
  4074.  
  4075. ```
  4076.  
  4077.  
  4078.  
  4079.  
  4080. <div>
  4081. <style scoped>
  4082.     .dataframe tbody tr th:only-of-type {
  4083.         vertical-align: middle;
  4084.     }
  4085.  
  4086.     .dataframe tbody tr th {
  4087.         vertical-align: top;
  4088.     }
  4089.  
  4090.     .dataframe thead th {
  4091.         text-align: right;
  4092.     }
  4093. </style>
  4094. <table border="1" class="dataframe">
  4095.   <thead>
  4096.     <tr style="text-align: right;">
  4097.       <th>ad_unit_result</th>
  4098.       <th>0</th>
  4099.       <th>1</th>
  4100.       <th>2</th>
  4101.     </tr>
  4102.     <tr>
  4103.       <th>lmt</th>
  4104.       <th></th>
  4105.       <th></th>
  4106.       <th></th>
  4107.     </tr>
  4108.   </thead>
  4109.   <tbody>
  4110.     <tr>
  4111.       <th>-1</th>
  4112.       <td>229</td>
  4113.       <td>150</td>
  4114.       <td>103</td>
  4115.     </tr>
  4116.     <tr>
  4117.       <th>1</th>
  4118.       <td>123</td>
  4119.       <td>3</td>
  4120.       <td>275</td>
  4121.     </tr>
  4122.   </tbody>
  4123. </table>
  4124. </div>
  4125.  
  4126.  
  4127.  
  4128.  
  4129. ```python
  4130. table = df_with_campaign.pivot_table(index='sdk', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  4131. table
  4132.  
  4133. ```
  4134.  
  4135.  
  4136.  
  4137.  
  4138. <div>
  4139. <style scoped>
  4140.     .dataframe tbody tr th:only-of-type {
  4141.         vertical-align: middle;
  4142.     }
  4143.  
  4144.     .dataframe tbody tr th {
  4145.         vertical-align: top;
  4146.     }
  4147.  
  4148.     .dataframe thead th {
  4149.         text-align: right;
  4150.     }
  4151. </style>
  4152. <table border="1" class="dataframe">
  4153.   <thead>
  4154.     <tr style="text-align: right;">
  4155.       <th>ad_unit_result</th>
  4156.       <th>0</th>
  4157.       <th>1</th>
  4158.       <th>2</th>
  4159.     </tr>
  4160.     <tr>
  4161.       <th>sdk</th>
  4162.       <th></th>
  4163.       <th></th>
  4164.       <th></th>
  4165.     </tr>
  4166.   </thead>
  4167.   <tbody>
  4168.     <tr>
  4169.       <th>1.3.9</th>
  4170.       <td>0</td>
  4171.       <td>8</td>
  4172.       <td>0</td>
  4173.     </tr>
  4174.     <tr>
  4175.       <th>2.4.10</th>
  4176.       <td>60</td>
  4177.       <td>29</td>
  4178.       <td>0</td>
  4179.     </tr>
  4180.     <tr>
  4181.       <th>2.4.8</th>
  4182.       <td>4</td>
  4183.       <td>109</td>
  4184.       <td>0</td>
  4185.     </tr>
  4186.     <tr>
  4187.       <th>2.5.3</th>
  4188.       <td>287</td>
  4189.       <td>7</td>
  4190.       <td>378</td>
  4191.     </tr>
  4192.     <tr>
  4193.       <th>2.5.5</th>
  4194.       <td>1</td>
  4195.       <td>0</td>
  4196.       <td>0</td>
  4197.     </tr>
  4198.   </tbody>
  4199. </table>
  4200. </div>
  4201.  
  4202.  
  4203.  
  4204.  
  4205. ```python
  4206. table = df_with_campaign.pivot_table(index='ver', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  4207. table
  4208.  
  4209. ```
  4210.  
  4211.  
  4212.  
  4213.  
  4214. <div>
  4215. <style scoped>
  4216.     .dataframe tbody tr th:only-of-type {
  4217.         vertical-align: middle;
  4218.     }
  4219.  
  4220.     .dataframe tbody tr th {
  4221.         vertical-align: top;
  4222.     }
  4223.  
  4224.     .dataframe thead th {
  4225.         text-align: right;
  4226.     }
  4227. </style>
  4228. <table border="1" class="dataframe">
  4229.   <thead>
  4230.     <tr style="text-align: right;">
  4231.       <th>ad_unit_result</th>
  4232.       <th>0</th>
  4233.       <th>1</th>
  4234.       <th>2</th>
  4235.     </tr>
  4236.     <tr>
  4237.       <th>ver</th>
  4238.       <th></th>
  4239.       <th></th>
  4240.       <th></th>
  4241.     </tr>
  4242.   </thead>
  4243.   <tbody>
  4244.     <tr>
  4245.       <th>2.1.84</th>
  4246.       <td>2</td>
  4247.       <td>0</td>
  4248.       <td>5</td>
  4249.     </tr>
  4250.     <tr>
  4251.       <th>2.1.86</th>
  4252.       <td>2</td>
  4253.       <td>0</td>
  4254.       <td>5</td>
  4255.     </tr>
  4256.     <tr>
  4257.       <th>2.1.88</th>
  4258.       <td>102</td>
  4259.       <td>3</td>
  4260.       <td>167</td>
  4261.     </tr>
  4262.     <tr>
  4263.       <th>2.1.90</th>
  4264.       <td>181</td>
  4265.       <td>4</td>
  4266.       <td>201</td>
  4267.     </tr>
  4268.     <tr>
  4269.       <th>2.5.3</th>
  4270.       <td>1</td>
  4271.       <td>0</td>
  4272.       <td>0</td>
  4273.     </tr>
  4274.     <tr>
  4275.       <th>UNKNOWN</th>
  4276.       <td>64</td>
  4277.       <td>146</td>
  4278.       <td>0</td>
  4279.     </tr>
  4280.   </tbody>
  4281. </table>
  4282. </div>
  4283.  
  4284.  
  4285.  
  4286.  
  4287. ```python
  4288. table = df_with_campaign.pivot_table(index='consent', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  4289. table
  4290.  
  4291. ```
  4292.  
  4293.  
  4294.  
  4295.  
  4296. <div>
  4297. <style scoped>
  4298.     .dataframe tbody tr th:only-of-type {
  4299.         vertical-align: middle;
  4300.     }
  4301.  
  4302.     .dataframe tbody tr th {
  4303.         vertical-align: top;
  4304.     }
  4305.  
  4306.     .dataframe thead th {
  4307.         text-align: right;
  4308.     }
  4309. </style>
  4310. <table border="1" class="dataframe">
  4311.   <thead>
  4312.     <tr style="text-align: right;">
  4313.       <th>ad_unit_result</th>
  4314.       <th>0</th>
  4315.       <th>1</th>
  4316.       <th>2</th>
  4317.     </tr>
  4318.     <tr>
  4319.       <th>consent</th>
  4320.       <th></th>
  4321.       <th></th>
  4322.       <th></th>
  4323.     </tr>
  4324.   </thead>
  4325.   <tbody>
  4326.     <tr>
  4327.       <th>True</th>
  4328.       <td>73</td>
  4329.       <td>3</td>
  4330.       <td>244</td>
  4331.     </tr>
  4332.     <tr>
  4333.       <th>UNKNOWN</th>
  4334.       <td>279</td>
  4335.       <td>150</td>
  4336.       <td>134</td>
  4337.     </tr>
  4338.   </tbody>
  4339. </table>
  4340. </div>
  4341.  
  4342.  
  4343.  
  4344.  
  4345. ```python
  4346. table = df_with_campaign.pivot_table(index='locale', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  4347. table
  4348.  
  4349.  
  4350. ```
  4351.  
  4352.  
  4353.  
  4354.  
  4355. <div>
  4356. <style scoped>
  4357.     .dataframe tbody tr th:only-of-type {
  4358.         vertical-align: middle;
  4359.     }
  4360.  
  4361.     .dataframe tbody tr th {
  4362.         vertical-align: top;
  4363.     }
  4364.  
  4365.     .dataframe thead th {
  4366.         text-align: right;
  4367.     }
  4368. </style>
  4369. <table border="1" class="dataframe">
  4370.   <thead>
  4371.     <tr style="text-align: right;">
  4372.       <th>ad_unit_result</th>
  4373.       <th>0</th>
  4374.       <th>1</th>
  4375.       <th>2</th>
  4376.     </tr>
  4377.     <tr>
  4378.       <th>locale</th>
  4379.       <th></th>
  4380.       <th></th>
  4381.       <th></th>
  4382.     </tr>
  4383.   </thead>
  4384.   <tbody>
  4385.     <tr>
  4386.       <th>UNKNOWN</th>
  4387.       <td>64</td>
  4388.       <td>146</td>
  4389.       <td>0</td>
  4390.     </tr>
  4391.     <tr>
  4392.       <th>de-DE</th>
  4393.       <td>3</td>
  4394.       <td>0</td>
  4395.       <td>3</td>
  4396.     </tr>
  4397.     <tr>
  4398.       <th>el-GR</th>
  4399.       <td>0</td>
  4400.       <td>0</td>
  4401.       <td>1</td>
  4402.     </tr>
  4403.     <tr>
  4404.       <th>en</th>
  4405.       <td>3</td>
  4406.       <td>0</td>
  4407.       <td>5</td>
  4408.     </tr>
  4409.     <tr>
  4410.       <th>en-AU</th>
  4411.       <td>1</td>
  4412.       <td>1</td>
  4413.       <td>11</td>
  4414.     </tr>
  4415.     <tr>
  4416.       <th>en-CA</th>
  4417.       <td>3</td>
  4418.       <td>0</td>
  4419.       <td>6</td>
  4420.     </tr>
  4421.     <tr>
  4422.       <th>en-DE</th>
  4423.       <td>0</td>
  4424.       <td>0</td>
  4425.       <td>1</td>
  4426.     </tr>
  4427.     <tr>
  4428.       <th>en-GB</th>
  4429.       <td>20</td>
  4430.       <td>0</td>
  4431.       <td>58</td>
  4432.     </tr>
  4433.     <tr>
  4434.       <th>en-GI</th>
  4435.       <td>2</td>
  4436.       <td>0</td>
  4437.       <td>0</td>
  4438.     </tr>
  4439.     <tr>
  4440.       <th>en-GY</th>
  4441.       <td>12</td>
  4442.       <td>0</td>
  4443.       <td>2</td>
  4444.     </tr>
  4445.     <tr>
  4446.       <th>en-IE</th>
  4447.       <td>1</td>
  4448.       <td>0</td>
  4449.       <td>2</td>
  4450.     </tr>
  4451.     <tr>
  4452.       <th>en-IN</th>
  4453.       <td>0</td>
  4454.       <td>0</td>
  4455.       <td>1</td>
  4456.     </tr>
  4457.     <tr>
  4458.       <th>en-IO</th>
  4459.       <td>1</td>
  4460.       <td>0</td>
  4461.       <td>2</td>
  4462.     </tr>
  4463.     <tr>
  4464.       <th>en-JM</th>
  4465.       <td>1</td>
  4466.       <td>0</td>
  4467.       <td>1</td>
  4468.     </tr>
  4469.     <tr>
  4470.       <th>en-KY</th>
  4471.       <td>1</td>
  4472.       <td>0</td>
  4473.       <td>0</td>
  4474.     </tr>
  4475.     <tr>
  4476.       <th>en-MT</th>
  4477.       <td>2</td>
  4478.       <td>0</td>
  4479.       <td>0</td>
  4480.     </tr>
  4481.     <tr>
  4482.       <th>en-MY</th>
  4483.       <td>3</td>
  4484.       <td>0</td>
  4485.       <td>3</td>
  4486.     </tr>
  4487.     <tr>
  4488.       <th>en-NL</th>
  4489.       <td>2</td>
  4490.       <td>0</td>
  4491.       <td>0</td>
  4492.     </tr>
  4493.     <tr>
  4494.       <th>en-PH</th>
  4495.       <td>20</td>
  4496.       <td>1</td>
  4497.       <td>50</td>
  4498.     </tr>
  4499.     <tr>
  4500.       <th>en-PR</th>
  4501.       <td>1</td>
  4502.       <td>0</td>
  4503.       <td>0</td>
  4504.     </tr>
  4505.     <tr>
  4506.       <th>en-QA</th>
  4507.       <td>0</td>
  4508.       <td>0</td>
  4509.       <td>1</td>
  4510.     </tr>
  4511.     <tr>
  4512.       <th>en-SG</th>
  4513.       <td>1</td>
  4514.       <td>0</td>
  4515.       <td>1</td>
  4516.     </tr>
  4517.     <tr>
  4518.       <th>en-TH</th>
  4519.       <td>1</td>
  4520.       <td>0</td>
  4521.       <td>0</td>
  4522.     </tr>
  4523.     <tr>
  4524.       <th>en-TT</th>
  4525.       <td>38</td>
  4526.       <td>0</td>
  4527.       <td>5</td>
  4528.     </tr>
  4529.     <tr>
  4530.       <th>en-US</th>
  4531.       <td>57</td>
  4532.       <td>5</td>
  4533.       <td>179</td>
  4534.     </tr>
  4535.     <tr>
  4536.       <th>en-ZA</th>
  4537.       <td>1</td>
  4538.       <td>0</td>
  4539.       <td>1</td>
  4540.     </tr>
  4541.     <tr>
  4542.       <th>fi-FI</th>
  4543.       <td>1</td>
  4544.       <td>0</td>
  4545.       <td>0</td>
  4546.     </tr>
  4547.     <tr>
  4548.       <th>fr</th>
  4549.       <td>0</td>
  4550.       <td>0</td>
  4551.       <td>1</td>
  4552.     </tr>
  4553.     <tr>
  4554.       <th>fr-BE</th>
  4555.       <td>10</td>
  4556.       <td>0</td>
  4557.       <td>0</td>
  4558.     </tr>
  4559.     <tr>
  4560.       <th>fr-CA</th>
  4561.       <td>2</td>
  4562.       <td>0</td>
  4563.       <td>8</td>
  4564.     </tr>
  4565.     <tr>
  4566.       <th>fr-CH</th>
  4567.       <td>10</td>
  4568.       <td>0</td>
  4569.       <td>1</td>
  4570.     </tr>
  4571.     <tr>
  4572.       <th>fr-CI</th>
  4573.       <td>1</td>
  4574.       <td>0</td>
  4575.       <td>0</td>
  4576.     </tr>
  4577.     <tr>
  4578.       <th>fr-FR</th>
  4579.       <td>44</td>
  4580.       <td>0</td>
  4581.       <td>19</td>
  4582.     </tr>
  4583.     <tr>
  4584.       <th>fr-GF</th>
  4585.       <td>0</td>
  4586.       <td>0</td>
  4587.       <td>1</td>
  4588.     </tr>
  4589.     <tr>
  4590.       <th>fr-GP</th>
  4591.       <td>0</td>
  4592.       <td>0</td>
  4593.       <td>1</td>
  4594.     </tr>
  4595.     <tr>
  4596.       <th>fr-RE</th>
  4597.       <td>0</td>
  4598.       <td>0</td>
  4599.       <td>2</td>
  4600.     </tr>
  4601.     <tr>
  4602.       <th>it-IT</th>
  4603.       <td>4</td>
  4604.       <td>0</td>
  4605.       <td>1</td>
  4606.     </tr>
  4607.     <tr>
  4608.       <th>nl-BE</th>
  4609.       <td>12</td>
  4610.       <td>0</td>
  4611.       <td>0</td>
  4612.     </tr>
  4613.     <tr>
  4614.       <th>nl-NL</th>
  4615.       <td>15</td>
  4616.       <td>0</td>
  4617.       <td>5</td>
  4618.     </tr>
  4619.     <tr>
  4620.       <th>ru-BY</th>
  4621.       <td>1</td>
  4622.       <td>0</td>
  4623.       <td>0</td>
  4624.     </tr>
  4625.     <tr>
  4626.       <th>sv-SE</th>
  4627.       <td>5</td>
  4628.       <td>0</td>
  4629.       <td>0</td>
  4630.     </tr>
  4631.     <tr>
  4632.       <th>th-TH</th>
  4633.       <td>3</td>
  4634.       <td>0</td>
  4635.       <td>2</td>
  4636.     </tr>
  4637.     <tr>
  4638.       <th>zh-HK</th>
  4639.       <td>1</td>
  4640.       <td>0</td>
  4641.       <td>2</td>
  4642.     </tr>
  4643.     <tr>
  4644.       <th>zh-Hant-TW</th>
  4645.       <td>5</td>
  4646.       <td>0</td>
  4647.       <td>2</td>
  4648.     </tr>
  4649.   </tbody>
  4650. </table>
  4651. </div>
  4652.  
  4653.  
  4654.  
  4655.  
  4656. ```python
  4657. table = df_with_campaign.pivot_table(index='webview_version', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  4658. table
  4659.  
  4660. ```
  4661.  
  4662.  
  4663.  
  4664.  
  4665. <div>
  4666. <style scoped>
  4667.     .dataframe tbody tr th:only-of-type {
  4668.         vertical-align: middle;
  4669.     }
  4670.  
  4671.     .dataframe tbody tr th {
  4672.         vertical-align: top;
  4673.     }
  4674.  
  4675.     .dataframe thead th {
  4676.         text-align: right;
  4677.     }
  4678. </style>
  4679. <table border="1" class="dataframe">
  4680.   <thead>
  4681.     <tr style="text-align: right;">
  4682.       <th>ad_unit_result</th>
  4683.       <th>0</th>
  4684.       <th>1</th>
  4685.       <th>2</th>
  4686.     </tr>
  4687.     <tr>
  4688.       <th>webview_version</th>
  4689.       <th></th>
  4690.       <th></th>
  4691.       <th></th>
  4692.     </tr>
  4693.   </thead>
  4694.   <tbody>
  4695.     <tr>
  4696.       <th>UNKNOWN</th>
  4697.       <td>352</td>
  4698.       <td>153</td>
  4699.       <td>378</td>
  4700.     </tr>
  4701.   </tbody>
  4702. </table>
  4703. </div>
  4704.  
  4705.  
  4706.  
  4707.  
  4708. ```python
  4709. table = df_with_campaign_failed.pivot_table(index='mccmnc', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  4710. table = table.sort_values(by=[2], ascending=False)
  4711. table
  4712.  
  4713. ```
  4714.  
  4715.  
  4716.  
  4717.  
  4718. <div>
  4719. <style scoped>
  4720.     .dataframe tbody tr th:only-of-type {
  4721.         vertical-align: middle;
  4722.     }
  4723.  
  4724.     .dataframe tbody tr th {
  4725.         vertical-align: top;
  4726.     }
  4727.  
  4728.     .dataframe thead th {
  4729.         text-align: right;
  4730.     }
  4731. </style>
  4732. <table border="1" class="dataframe">
  4733.   <thead>
  4734.     <tr style="text-align: right;">
  4735.       <th>ad_unit_result</th>
  4736.       <th>1</th>
  4737.       <th>2</th>
  4738.     </tr>
  4739.     <tr>
  4740.       <th>mccmnc</th>
  4741.       <th></th>
  4742.       <th></th>
  4743.     </tr>
  4744.   </thead>
  4745.   <tbody>
  4746.     <tr>
  4747.       <th>UNKNOWN</th>
  4748.       <td>149</td>
  4749.       <td>140</td>
  4750.     </tr>
  4751.     <tr>
  4752.       <th>311-480</th>
  4753.       <td>1</td>
  4754.       <td>55</td>
  4755.     </tr>
  4756.     <tr>
  4757.       <th>310-260</th>
  4758.       <td>0</td>
  4759.       <td>40</td>
  4760.     </tr>
  4761.     <tr>
  4762.       <th>310-410</th>
  4763.       <td>0</td>
  4764.       <td>36</td>
  4765.     </tr>
  4766.     <tr>
  4767.       <th>515-02</th>
  4768.       <td>0</td>
  4769.       <td>22</td>
  4770.     </tr>
  4771.     <tr>
  4772.       <th>515-03</th>
  4773.       <td>0</td>
  4774.       <td>15</td>
  4775.     </tr>
  4776.     <tr>
  4777.       <th>310-120</th>
  4778.       <td>0</td>
  4779.       <td>13</td>
  4780.     </tr>
  4781.     <tr>
  4782.       <th>312-530</th>
  4783.       <td>2</td>
  4784.       <td>4</td>
  4785.     </tr>
  4786.     <tr>
  4787.       <th>311-580</th>
  4788.       <td>0</td>
  4789.       <td>4</td>
  4790.     </tr>
  4791.     <tr>
  4792.       <th>374-12</th>
  4793.       <td>0</td>
  4794.       <td>3</td>
  4795.     </tr>
  4796.     <tr>
  4797.       <th>234-10</th>
  4798.       <td>0</td>
  4799.       <td>2</td>
  4800.     </tr>
  4801.     <tr>
  4802.       <th>604-02</th>
  4803.       <td>0</td>
  4804.       <td>2</td>
  4805.     </tr>
  4806.     <tr>
  4807.       <th>502-18</th>
  4808.       <td>0</td>
  4809.       <td>2</td>
  4810.     </tr>
  4811.     <tr>
  4812.       <th>457-08</th>
  4813.       <td>0</td>
  4814.       <td>2</td>
  4815.     </tr>
  4816.     <tr>
  4817.       <th>454-00</th>
  4818.       <td>0</td>
  4819.       <td>2</td>
  4820.     </tr>
  4821.     <tr>
  4822.       <th>208-15</th>
  4823.       <td>0</td>
  4824.       <td>2</td>
  4825.     </tr>
  4826.     <tr>
  4827.       <th>206-10</th>
  4828.       <td>0</td>
  4829.       <td>2</td>
  4830.     </tr>
  4831.     <tr>
  4832.       <th>208-20</th>
  4833.       <td>0</td>
  4834.       <td>2</td>
  4835.     </tr>
  4836.     <tr>
  4837.       <th>204-16</th>
  4838.       <td>0</td>
  4839.       <td>2</td>
  4840.     </tr>
  4841.     <tr>
  4842.       <th>302-610</th>
  4843.       <td>0</td>
  4844.       <td>2</td>
  4845.     </tr>
  4846.     <tr>
  4847.       <th>302-720</th>
  4848.       <td>0</td>
  4849.       <td>2</td>
  4850.     </tr>
  4851.     <tr>
  4852.       <th>262-03</th>
  4853.       <td>0</td>
  4854.       <td>2</td>
  4855.     </tr>
  4856.     <tr>
  4857.       <th>302-220</th>
  4858.       <td>0</td>
  4859.       <td>1</td>
  4860.     </tr>
  4861.     <tr>
  4862.       <th>620-01</th>
  4863.       <td>0</td>
  4864.       <td>1</td>
  4865.     </tr>
  4866.     <tr>
  4867.       <th>262-02</th>
  4868.       <td>0</td>
  4869.       <td>1</td>
  4870.     </tr>
  4871.     <tr>
  4872.       <th>604-01</th>
  4873.       <td>0</td>
  4874.       <td>1</td>
  4875.     </tr>
  4876.     <tr>
  4877.       <th>603-02</th>
  4878.       <td>0</td>
  4879.       <td>1</td>
  4880.     </tr>
  4881.     <tr>
  4882.       <th>528-11</th>
  4883.       <td>0</td>
  4884.       <td>1</td>
  4885.     </tr>
  4886.     <tr>
  4887.       <th>208-01</th>
  4888.       <td>0</td>
  4889.       <td>1</td>
  4890.     </tr>
  4891.     <tr>
  4892.       <th>208-10</th>
  4893.       <td>0</td>
  4894.       <td>1</td>
  4895.     </tr>
  4896.     <tr>
  4897.       <th>505-02</th>
  4898.       <td>0</td>
  4899.       <td>1</td>
  4900.     </tr>
  4901.     <tr>
  4902.       <th>505-01</th>
  4903.       <td>1</td>
  4904.       <td>1</td>
  4905.     </tr>
  4906.     <tr>
  4907.       <th>222-99</th>
  4908.       <td>0</td>
  4909.       <td>1</td>
  4910.     </tr>
  4911.     <tr>
  4912.       <th>311-230</th>
  4913.       <td>0</td>
  4914.       <td>1</td>
  4915.     </tr>
  4916.     <tr>
  4917.       <th>440-10</th>
  4918.       <td>0</td>
  4919.       <td>1</td>
  4920.     </tr>
  4921.     <tr>
  4922.       <th>424-02</th>
  4923.       <td>0</td>
  4924.       <td>1</td>
  4925.     </tr>
  4926.     <tr>
  4927.       <th>420-01</th>
  4928.       <td>0</td>
  4929.       <td>1</td>
  4930.     </tr>
  4931.     <tr>
  4932.       <th>404-72</th>
  4933.       <td>0</td>
  4934.       <td>1</td>
  4935.     </tr>
  4936.     <tr>
  4937.       <th>234-57</th>
  4938.       <td>0</td>
  4939.       <td>1</td>
  4940.     </tr>
  4941.     <tr>
  4942.       <th>340-01</th>
  4943.       <td>0</td>
  4944.       <td>1</td>
  4945.     </tr>
  4946.     <tr>
  4947.       <th>338-180</th>
  4948.       <td>0</td>
  4949.       <td>1</td>
  4950.     </tr>
  4951.     <tr>
  4952.       <th>234-15</th>
  4953.       <td>0</td>
  4954.       <td>1</td>
  4955.     </tr>
  4956.     <tr>
  4957.       <th>310-150</th>
  4958.       <td>0</td>
  4959.       <td>1</td>
  4960.     </tr>
  4961.     <tr>
  4962.       <th>234-20</th>
  4963.       <td>0</td>
  4964.       <td>1</td>
  4965.     </tr>
  4966.   </tbody>
  4967. </table>
  4968. </div>
  4969.  
  4970.  
  4971.  
  4972.  
  4973. ```python
  4974. table = df_with_campaign_failed.pivot_table(index='ua', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  4975. table = table.sort_values(by=[2], ascending=False)
  4976. table
  4977.  
  4978. ```
  4979.  
  4980.  
  4981.  
  4982.  
  4983. <div>
  4984. <style scoped>
  4985.     .dataframe tbody tr th:only-of-type {
  4986.         vertical-align: middle;
  4987.     }
  4988.  
  4989.     .dataframe tbody tr th {
  4990.         vertical-align: top;
  4991.     }
  4992.  
  4993.     .dataframe thead th {
  4994.         text-align: right;
  4995.     }
  4996. </style>
  4997. <table border="1" class="dataframe">
  4998.   <thead>
  4999.     <tr style="text-align: right;">
  5000.       <th>ad_unit_result</th>
  5001.       <th>1</th>
  5002.       <th>2</th>
  5003.     </tr>
  5004.     <tr>
  5005.       <th>ua</th>
  5006.       <th></th>
  5007.       <th></th>
  5008.     </tr>
  5009.   </thead>
  5010.   <tbody>
  5011.     <tr>
  5012.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/607.2.6 (KHTML, like Gecko) Mobile/16F203 WordWow/2.1.90</th>
  5013.       <td>0</td>
  5014.       <td>73</td>
  5015.     </tr>
  5016.     <tr>
  5017.       <th>Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G36 WordWow/2.1.90</th>
  5018.       <td>1</td>
  5019.       <td>65</td>
  5020.     </tr>
  5021.     <tr>
  5022.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/607.2.6 (KHTML, like Gecko) Mobile/16F203 WordWow/2.1.88</th>
  5023.       <td>0</td>
  5024.       <td>47</td>
  5025.     </tr>
  5026.     <tr>
  5027.       <th>Mozilla/5.0 (iPad; CPU OS 12_3_1 like Mac OS X) AppleWebKit/607.2.6 (KHTML, like Gecko) Mobile/16F203 WordWow/2.1.88</th>
  5028.       <td>1</td>
  5029.       <td>25</td>
  5030.     </tr>
  5031.     <tr>
  5032.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_4 like Mac OS X) AppleWebKit/606.4.5 (KHTML, like Gecko) Mobile/16D57 WordWow/2.1.88</th>
  5033.       <td>0</td>
  5034.       <td>21</td>
  5035.     </tr>
  5036.     <tr>
  5037.       <th>Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G36 WordWow/2.1.88</th>
  5038.       <td>0</td>
  5039.       <td>21</td>
  5040.     </tr>
  5041.     <tr>
  5042.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/607.1.40 (KHTML, like Gecko) Mobile/16E227 WordWow/2.1.88</th>
  5043.       <td>2</td>
  5044.       <td>11</td>
  5045.     </tr>
  5046.     <tr>
  5047.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like Mac OS X) AppleWebKit/605.3.8 (KHTML, like Gecko) Mobile/15G77 WordWow/2.1.90</th>
  5048.       <td>0</td>
  5049.       <td>11</td>
  5050.     </tr>
  5051.     <tr>
  5052.       <th>Mozilla/5.0 (iPad; CPU OS 12_3_1 like Mac OS X) AppleWebKit/607.2.6 (KHTML, like Gecko) Mobile/16F203 WordWow/2.1.90</th>
  5053.       <td>0</td>
  5054.       <td>9</td>
  5055.     </tr>
  5056.     <tr>
  5057.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_2 like Mac OS X) AppleWebKit/607.2.6 (KHTML, like Gecko) Mobile/16F250 WordWow/2.1.90</th>
  5058.       <td>1</td>
  5059.       <td>8</td>
  5060.     </tr>
  5061.     <tr>
  5062.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_2 like Mac OS X) AppleWebKit/607.2.6 (KHTML, like Gecko) Mobile/16F250 WordWow/2.1.88</th>
  5063.       <td>0</td>
  5064.       <td>8</td>
  5065.     </tr>
  5066.     <tr>
  5067.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like Mac OS X) AppleWebKit/605.3.8 (KHTML, like Gecko) Mobile/15G77 WordWow/2.1.88</th>
  5068.       <td>0</td>
  5069.       <td>8</td>
  5070.     </tr>
  5071.     <tr>
  5072.       <th>Mozilla/5.0 (iPad; CPU OS 12_3 like Mac OS X) AppleWebKit/607.2.6 (KHTML, like Gecko) Mobile/16F156 WordWow/2.1.90</th>
  5073.       <td>0</td>
  5074.       <td>5</td>
  5075.     </tr>
  5076.     <tr>
  5077.       <th>Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/607.1.40 (KHTML, like Gecko) Mobile/16E227 WordWow/2.1.90</th>
  5078.       <td>0</td>
  5079.       <td>5</td>
  5080.     </tr>
  5081.     <tr>
  5082.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_2 like Mac OS X) AppleWebKit/606.3.4 (KHTML, like Gecko) Mobile/16C101 WordWow/2.1.88</th>
  5083.       <td>0</td>
  5084.       <td>5</td>
  5085.     </tr>
  5086.     <tr>
  5087.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_5 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G36 WordWow/2.1.88</th>
  5088.       <td>0</td>
  5089.       <td>4</td>
  5090.     </tr>
  5091.     <tr>
  5092.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 11_0_1 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Mobile/15A402 WordWow/2.1.84</th>
  5093.       <td>0</td>
  5094.       <td>3</td>
  5095.     </tr>
  5096.     <tr>
  5097.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_2 like Mac OS X) AppleWebKit/606.3.4 (KHTML, like Gecko) Mobile/16C101 WordWow/2.1.90</th>
  5098.       <td>0</td>
  5099.       <td>3</td>
  5100.     </tr>
  5101.     <tr>
  5102.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_0_1 like Mac OS X) AppleWebKit/606.1.36 (KHTML, like Gecko) Mobile/16A404 WordWow/2.1.90</th>
  5103.       <td>0</td>
  5104.       <td>3</td>
  5105.     </tr>
  5106.     <tr>
  5107.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Mobile/14G60 WordWow/2.1.88</th>
  5108.       <td>0</td>
  5109.       <td>3</td>
  5110.     </tr>
  5111.     <tr>
  5112.       <th>Mozilla/5.0 (iPad; CPU OS 12_1 like Mac OS X) AppleWebKit/606.2.104 (KHTML, like Gecko) Mobile/16B92 WordWow/2.1.88</th>
  5113.       <td>0</td>
  5114.       <td>2</td>
  5115.     </tr>
  5116.     <tr>
  5117.       <th>Mozilla/5.0 (iPad; CPU OS 12_3_1 like Mac OS X) AppleWebKit/607.2.6 (KHTML, like Gecko) Mobile/16F203 WordWow/2.1.86</th>
  5118.       <td>0</td>
  5119.       <td>2</td>
  5120.     </tr>
  5121.     <tr>
  5122.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_4 like Mac OS X) AppleWebKit/606.4.5 (KHTML, like Gecko) Mobile/16D57 WordWow/2.1.90</th>
  5123.       <td>0</td>
  5124.       <td>2</td>
  5125.     </tr>
  5126.     <tr>
  5127.       <th>Mozilla/5.0 (iPad; CPU OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Mobile/14G60 WordWow/2.1.90</th>
  5128.       <td>0</td>
  5129.       <td>2</td>
  5130.     </tr>
  5131.     <tr>
  5132.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/603.2.4 (KHTML, like Gecko) Mobile/14F89 WordWow/2.1.90</th>
  5133.       <td>0</td>
  5134.       <td>2</td>
  5135.     </tr>
  5136.     <tr>
  5137.       <th>Mozilla/5.0 (iPad; CPU OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13F69 WordWow/2.1.88</th>
  5138.       <td>0</td>
  5139.       <td>2</td>
  5140.     </tr>
  5141.     <tr>
  5142.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/607.1.40 (KHTML, like Gecko) Mobile/16E227 WordWow/2.1.90</th>
  5143.       <td>0</td>
  5144.       <td>2</td>
  5145.     </tr>
  5146.     <tr>
  5147.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_3 like Mac OS X) AppleWebKit/606.4.5 (KHTML, like Gecko) Mobile/16D39 WordWow/2.1.90</th>
  5148.       <td>0</td>
  5149.       <td>2</td>
  5150.     </tr>
  5151.     <tr>
  5152.       <th>Mozilla/5.0 (iPad; CPU OS 11_4_1 like Mac OS X) AppleWebKit/605.3.8 (KHTML, like Gecko) Mobile/15G77 WordWow/2.1.88</th>
  5153.       <td>0</td>
  5154.       <td>2</td>
  5155.     </tr>
  5156.     <tr>
  5157.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Mobile/15D100 WordWow/2.1.86</th>
  5158.       <td>0</td>
  5159.       <td>2</td>
  5160.     </tr>
  5161.     <tr>
  5162.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_5 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G36 WordWow/2.1.90</th>
  5163.       <td>0</td>
  5164.       <td>1</td>
  5165.     </tr>
  5166.     <tr>
  5167.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/607.2.6 (KHTML, like Gecko) Mobile/16F203 WordWow/2.1.84</th>
  5168.       <td>0</td>
  5169.       <td>1</td>
  5170.     </tr>
  5171.     <tr>
  5172.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3 like Mac OS X) AppleWebKit/607.2.6 (KHTML, like Gecko) Mobile/16F156 WordWow/2.1.90</th>
  5173.       <td>0</td>
  5174.       <td>1</td>
  5175.     </tr>
  5176.     <tr>
  5177.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3 like Mac OS X) AppleWebKit/607.2.6 (KHTML, like Gecko) Mobile/16F156 WordWow/2.1.88</th>
  5178.       <td>0</td>
  5179.       <td>1</td>
  5180.     </tr>
  5181.     <tr>
  5182.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_4 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G35 WordWow/2.1.88</th>
  5183.       <td>0</td>
  5184.       <td>1</td>
  5185.     </tr>
  5186.     <tr>
  5187.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_3 like Mac OS X) AppleWebKit/607.2.6 (KHTML, like Gecko) Mobile/16F156 WordWow/2.1.86</th>
  5188.       <td>0</td>
  5189.       <td>1</td>
  5190.     </tr>
  5191.     <tr>
  5192.       <th>Mozilla/5.0 (iPad; CPU OS 10_0_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A456 WordWow/2.1.90</th>
  5193.       <td>0</td>
  5194.       <td>1</td>
  5195.     </tr>
  5196.     <tr>
  5197.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_3 like Mac OS X) AppleWebKit/606.4.5 (KHTML, like Gecko) Mobile/16D40 WordWow/2.1.90</th>
  5198.       <td>0</td>
  5199.       <td>1</td>
  5200.     </tr>
  5201.     <tr>
  5202.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_3 like Mac OS X) AppleWebKit/606.4.5 (KHTML, like Gecko) Mobile/16D39 WordWow/2.1.88</th>
  5203.       <td>0</td>
  5204.       <td>1</td>
  5205.     </tr>
  5206.     <tr>
  5207.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_2 like Mac OS X) AppleWebKit/606.3.4 (KHTML, like Gecko) Mobile/16C104 WordWow/2.1.88</th>
  5208.       <td>0</td>
  5209.       <td>1</td>
  5210.     </tr>
  5211.     <tr>
  5212.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/606.2.104 (KHTML, like Gecko) Mobile/16B92 WordWow/2.1.88</th>
  5213.       <td>0</td>
  5214.       <td>1</td>
  5215.     </tr>
  5216.     <tr>
  5217.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 12_0_1 like Mac OS X) AppleWebKit/606.1.36 (KHTML, like Gecko) Mobile/16A404 WordWow/2.1.88</th>
  5218.       <td>0</td>
  5219.       <td>1</td>
  5220.     </tr>
  5221.     <tr>
  5222.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.33 (KHTML, like Gecko) Mobile/15E216 WordWow/2.1.90</th>
  5223.       <td>0</td>
  5224.       <td>1</td>
  5225.     </tr>
  5226.     <tr>
  5227.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_5 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Mobile/15D60 WordWow/2.1.88</th>
  5228.       <td>0</td>
  5229.       <td>1</td>
  5230.     </tr>
  5231.     <tr>
  5232.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Mobile/14G60 WordWow/2.1.90</th>
  5233.       <td>0</td>
  5234.       <td>1</td>
  5235.     </tr>
  5236.     <tr>
  5237.       <th>Mozilla/5.0 (iPhone; CPU iPhone OS 10_2 like Mac OS X) AppleWebKit/602.3.12 (KHTML, like Gecko) Mobile/14C92 WordWow/2.1.90</th>
  5238.       <td>0</td>
  5239.       <td>1</td>
  5240.     </tr>
  5241.     <tr>
  5242.       <th>Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G36 WordWow/2.1.84</th>
  5243.       <td>0</td>
  5244.       <td>1</td>
  5245.     </tr>
  5246.     <tr>
  5247.       <th>Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/607.1.40 (KHTML, like Gecko) Mobile/16E227 WordWow/2.1.88</th>
  5248.       <td>0</td>
  5249.       <td>1</td>
  5250.     </tr>
  5251.     <tr>
  5252.       <th>Mozilla/5.0 (iPad; CPU OS 12_1_1 like Mac OS X) AppleWebKit/606.3.4 (KHTML, like Gecko) Mobile/16C50 WordWow/2.1.90</th>
  5253.       <td>2</td>
  5254.       <td>1</td>
  5255.     </tr>
  5256.     <tr>
  5257.       <th>Mozilla/5.0 (iPad; CPU OS 11_4_1 like Mac OS X) AppleWebKit/605.3.8 (KHTML, like Gecko) Mobile/15G77 WordWow/2.1.90</th>
  5258.       <td>0</td>
  5259.       <td>1</td>
  5260.     </tr>
  5261.     <tr>
  5262.       <th>UNKNOWN</th>
  5263.       <td>146</td>
  5264.       <td>0</td>
  5265.     </tr>
  5266.   </tbody>
  5267. </table>
  5268. </div>
  5269.  
  5270.  
  5271.  
  5272.  
  5273. ```python
  5274. table = df_with_campaign.pivot_table(index='session_id', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  5275. table['total'] = table[0] + table[2]
  5276. table = table.sort_values(by=[0], ascending=False)
  5277. table
  5278. ```
  5279.  
  5280.  
  5281.  
  5282.  
  5283. <div>
  5284. <style scoped>
  5285.     .dataframe tbody tr th:only-of-type {
  5286.         vertical-align: middle;
  5287.     }
  5288.  
  5289.     .dataframe tbody tr th {
  5290.         vertical-align: top;
  5291.     }
  5292.  
  5293.     .dataframe thead th {
  5294.         text-align: right;
  5295.     }
  5296. </style>
  5297. <table border="1" class="dataframe">
  5298.   <thead>
  5299.     <tr style="text-align: right;">
  5300.       <th>ad_unit_result</th>
  5301.       <th>0</th>
  5302.       <th>1</th>
  5303.       <th>2</th>
  5304.       <th>total</th>
  5305.     </tr>
  5306.     <tr>
  5307.       <th>session_id</th>
  5308.       <th></th>
  5309.       <th></th>
  5310.       <th></th>
  5311.       <th></th>
  5312.     </tr>
  5313.   </thead>
  5314.   <tbody>
  5315.     <tr>
  5316.       <th>-1</th>
  5317.       <td>64</td>
  5318.       <td>146</td>
  5319.       <td>0</td>
  5320.       <td>64</td>
  5321.     </tr>
  5322.     <tr>
  5323.       <th>2</th>
  5324.       <td>6</td>
  5325.       <td>0</td>
  5326.       <td>3</td>
  5327.       <td>9</td>
  5328.     </tr>
  5329.     <tr>
  5330.       <th>117</th>
  5331.       <td>5</td>
  5332.       <td>0</td>
  5333.       <td>0</td>
  5334.       <td>5</td>
  5335.     </tr>
  5336.     <tr>
  5337.       <th>10</th>
  5338.       <td>5</td>
  5339.       <td>0</td>
  5340.       <td>4</td>
  5341.       <td>9</td>
  5342.     </tr>
  5343.     <tr>
  5344.       <th>9</th>
  5345.       <td>4</td>
  5346.       <td>0</td>
  5347.       <td>3</td>
  5348.       <td>7</td>
  5349.     </tr>
  5350.     <tr>
  5351.       <th>139</th>
  5352.       <td>3</td>
  5353.       <td>0</td>
  5354.       <td>0</td>
  5355.       <td>3</td>
  5356.     </tr>
  5357.     <tr>
  5358.       <th>74</th>
  5359.       <td>3</td>
  5360.       <td>0</td>
  5361.       <td>1</td>
  5362.       <td>4</td>
  5363.     </tr>
  5364.     <tr>
  5365.       <th>12</th>
  5366.       <td>3</td>
  5367.       <td>0</td>
  5368.       <td>2</td>
  5369.       <td>5</td>
  5370.     </tr>
  5371.     <tr>
  5372.       <th>95</th>
  5373.       <td>3</td>
  5374.       <td>0</td>
  5375.       <td>0</td>
  5376.       <td>3</td>
  5377.     </tr>
  5378.     <tr>
  5379.       <th>97</th>
  5380.       <td>3</td>
  5381.       <td>0</td>
  5382.       <td>0</td>
  5383.       <td>3</td>
  5384.     </tr>
  5385.     <tr>
  5386.       <th>204</th>
  5387.       <td>3</td>
  5388.       <td>0</td>
  5389.       <td>1</td>
  5390.       <td>4</td>
  5391.     </tr>
  5392.     <tr>
  5393.       <th>21</th>
  5394.       <td>3</td>
  5395.       <td>0</td>
  5396.       <td>2</td>
  5397.       <td>5</td>
  5398.     </tr>
  5399.     <tr>
  5400.       <th>113</th>
  5401.       <td>3</td>
  5402.       <td>0</td>
  5403.       <td>0</td>
  5404.       <td>3</td>
  5405.     </tr>
  5406.     <tr>
  5407.       <th>22</th>
  5408.       <td>3</td>
  5409.       <td>0</td>
  5410.       <td>3</td>
  5411.       <td>6</td>
  5412.     </tr>
  5413.     <tr>
  5414.       <th>106</th>
  5415.       <td>3</td>
  5416.       <td>0</td>
  5417.       <td>0</td>
  5418.       <td>3</td>
  5419.     </tr>
  5420.     <tr>
  5421.       <th>8</th>
  5422.       <td>2</td>
  5423.       <td>0</td>
  5424.       <td>4</td>
  5425.       <td>6</td>
  5426.     </tr>
  5427.     <tr>
  5428.       <th>197</th>
  5429.       <td>2</td>
  5430.       <td>0</td>
  5431.       <td>0</td>
  5432.       <td>2</td>
  5433.     </tr>
  5434.     <tr>
  5435.       <th>170</th>
  5436.       <td>2</td>
  5437.       <td>1</td>
  5438.       <td>0</td>
  5439.       <td>2</td>
  5440.     </tr>
  5441.     <tr>
  5442.       <th>148</th>
  5443.       <td>2</td>
  5444.       <td>0</td>
  5445.       <td>2</td>
  5446.       <td>4</td>
  5447.     </tr>
  5448.     <tr>
  5449.       <th>147</th>
  5450.       <td>2</td>
  5451.       <td>0</td>
  5452.       <td>0</td>
  5453.       <td>2</td>
  5454.     </tr>
  5455.     <tr>
  5456.       <th>57</th>
  5457.       <td>2</td>
  5458.       <td>1</td>
  5459.       <td>1</td>
  5460.       <td>3</td>
  5461.     </tr>
  5462.     <tr>
  5463.       <th>179</th>
  5464.       <td>2</td>
  5465.       <td>0</td>
  5466.       <td>2</td>
  5467.       <td>4</td>
  5468.     </tr>
  5469.     <tr>
  5470.       <th>145</th>
  5471.       <td>2</td>
  5472.       <td>0</td>
  5473.       <td>0</td>
  5474.       <td>2</td>
  5475.     </tr>
  5476.     <tr>
  5477.       <th>14</th>
  5478.       <td>2</td>
  5479.       <td>0</td>
  5480.       <td>1</td>
  5481.       <td>3</td>
  5482.     </tr>
  5483.     <tr>
  5484.       <th>4</th>
  5485.       <td>2</td>
  5486.       <td>0</td>
  5487.       <td>2</td>
  5488.       <td>4</td>
  5489.     </tr>
  5490.     <tr>
  5491.       <th>196</th>
  5492.       <td>2</td>
  5493.       <td>0</td>
  5494.       <td>0</td>
  5495.       <td>2</td>
  5496.     </tr>
  5497.     <tr>
  5498.       <th>301</th>
  5499.       <td>2</td>
  5500.       <td>0</td>
  5501.       <td>0</td>
  5502.       <td>2</td>
  5503.     </tr>
  5504.     <tr>
  5505.       <th>300</th>
  5506.       <td>2</td>
  5507.       <td>0</td>
  5508.       <td>0</td>
  5509.       <td>2</td>
  5510.     </tr>
  5511.     <tr>
  5512.       <th>374</th>
  5513.       <td>2</td>
  5514.       <td>0</td>
  5515.       <td>0</td>
  5516.       <td>2</td>
  5517.     </tr>
  5518.     <tr>
  5519.       <th>360</th>
  5520.       <td>2</td>
  5521.       <td>0</td>
  5522.       <td>1</td>
  5523.       <td>3</td>
  5524.     </tr>
  5525.     <tr>
  5526.       <th>...</th>
  5527.       <td>...</td>
  5528.       <td>...</td>
  5529.       <td>...</td>
  5530.       <td>...</td>
  5531.     </tr>
  5532.     <tr>
  5533.       <th>50</th>
  5534.       <td>0</td>
  5535.       <td>0</td>
  5536.       <td>2</td>
  5537.       <td>2</td>
  5538.     </tr>
  5539.     <tr>
  5540.       <th>506</th>
  5541.       <td>0</td>
  5542.       <td>0</td>
  5543.       <td>1</td>
  5544.       <td>1</td>
  5545.     </tr>
  5546.     <tr>
  5547.       <th>507</th>
  5548.       <td>0</td>
  5549.       <td>0</td>
  5550.       <td>3</td>
  5551.       <td>3</td>
  5552.     </tr>
  5553.     <tr>
  5554.       <th>512</th>
  5555.       <td>0</td>
  5556.       <td>0</td>
  5557.       <td>1</td>
  5558.       <td>1</td>
  5559.     </tr>
  5560.     <tr>
  5561.       <th>44</th>
  5562.       <td>0</td>
  5563.       <td>0</td>
  5564.       <td>1</td>
  5565.       <td>1</td>
  5566.     </tr>
  5567.     <tr>
  5568.       <th>430</th>
  5569.       <td>0</td>
  5570.       <td>0</td>
  5571.       <td>1</td>
  5572.       <td>1</td>
  5573.     </tr>
  5574.     <tr>
  5575.       <th>3659</th>
  5576.       <td>0</td>
  5577.       <td>0</td>
  5578.       <td>1</td>
  5579.       <td>1</td>
  5580.     </tr>
  5581.     <tr>
  5582.       <th>1865</th>
  5583.       <td>0</td>
  5584.       <td>0</td>
  5585.       <td>1</td>
  5586.       <td>1</td>
  5587.     </tr>
  5588.     <tr>
  5589.       <th>368</th>
  5590.       <td>0</td>
  5591.       <td>0</td>
  5592.       <td>1</td>
  5593.       <td>1</td>
  5594.     </tr>
  5595.     <tr>
  5596.       <th>369</th>
  5597.       <td>0</td>
  5598.       <td>0</td>
  5599.       <td>1</td>
  5600.       <td>1</td>
  5601.     </tr>
  5602.     <tr>
  5603.       <th>37</th>
  5604.       <td>0</td>
  5605.       <td>0</td>
  5606.       <td>1</td>
  5607.       <td>1</td>
  5608.     </tr>
  5609.     <tr>
  5610.       <th>370</th>
  5611.       <td>0</td>
  5612.       <td>0</td>
  5613.       <td>1</td>
  5614.       <td>1</td>
  5615.     </tr>
  5616.     <tr>
  5617.       <th>20</th>
  5618.       <td>0</td>
  5619.       <td>0</td>
  5620.       <td>2</td>
  5621.       <td>2</td>
  5622.     </tr>
  5623.     <tr>
  5624.       <th>375</th>
  5625.       <td>0</td>
  5626.       <td>0</td>
  5627.       <td>1</td>
  5628.       <td>1</td>
  5629.     </tr>
  5630.     <tr>
  5631.       <th>377</th>
  5632.       <td>0</td>
  5633.       <td>0</td>
  5634.       <td>1</td>
  5635.       <td>1</td>
  5636.     </tr>
  5637.     <tr>
  5638.       <th>379</th>
  5639.       <td>0</td>
  5640.       <td>0</td>
  5641.       <td>1</td>
  5642.       <td>1</td>
  5643.     </tr>
  5644.     <tr>
  5645.       <th>381</th>
  5646.       <td>0</td>
  5647.       <td>0</td>
  5648.       <td>1</td>
  5649.       <td>1</td>
  5650.     </tr>
  5651.     <tr>
  5652.       <th>382</th>
  5653.       <td>0</td>
  5654.       <td>0</td>
  5655.       <td>1</td>
  5656.       <td>1</td>
  5657.     </tr>
  5658.     <tr>
  5659.       <th>385</th>
  5660.       <td>0</td>
  5661.       <td>1</td>
  5662.       <td>0</td>
  5663.       <td>0</td>
  5664.     </tr>
  5665.     <tr>
  5666.       <th>388</th>
  5667.       <td>0</td>
  5668.       <td>0</td>
  5669.       <td>1</td>
  5670.       <td>1</td>
  5671.     </tr>
  5672.     <tr>
  5673.       <th>391</th>
  5674.       <td>0</td>
  5675.       <td>0</td>
  5676.       <td>1</td>
  5677.       <td>1</td>
  5678.     </tr>
  5679.     <tr>
  5680.       <th>395</th>
  5681.       <td>0</td>
  5682.       <td>0</td>
  5683.       <td>1</td>
  5684.       <td>1</td>
  5685.     </tr>
  5686.     <tr>
  5687.       <th>397</th>
  5688.       <td>0</td>
  5689.       <td>0</td>
  5690.       <td>1</td>
  5691.       <td>1</td>
  5692.     </tr>
  5693.     <tr>
  5694.       <th>400</th>
  5695.       <td>0</td>
  5696.       <td>0</td>
  5697.       <td>1</td>
  5698.       <td>1</td>
  5699.     </tr>
  5700.     <tr>
  5701.       <th>409</th>
  5702.       <td>0</td>
  5703.       <td>0</td>
  5704.       <td>1</td>
  5705.       <td>1</td>
  5706.     </tr>
  5707.     <tr>
  5708.       <th>411</th>
  5709.       <td>0</td>
  5710.       <td>0</td>
  5711.       <td>1</td>
  5712.       <td>1</td>
  5713.     </tr>
  5714.     <tr>
  5715.       <th>1882</th>
  5716.       <td>0</td>
  5717.       <td>0</td>
  5718.       <td>1</td>
  5719.       <td>1</td>
  5720.     </tr>
  5721.     <tr>
  5722.       <th>423</th>
  5723.       <td>0</td>
  5724.       <td>0</td>
  5725.       <td>1</td>
  5726.       <td>1</td>
  5727.     </tr>
  5728.     <tr>
  5729.       <th>425</th>
  5730.       <td>0</td>
  5731.       <td>0</td>
  5732.       <td>1</td>
  5733.       <td>1</td>
  5734.     </tr>
  5735.     <tr>
  5736.       <th>483</th>
  5737.       <td>0</td>
  5738.       <td>0</td>
  5739.       <td>1</td>
  5740.       <td>1</td>
  5741.     </tr>
  5742.   </tbody>
  5743. </table>
  5744. <p>376 rows × 4 columns</p>
  5745. </div>
  5746.  
  5747.  
  5748.  
  5749.  
  5750. ```python
  5751. times = range(1, 100)
  5752. fill_rate = []
  5753. for interval in times:
  5754.     interval_data = df_with_campaign[(df_with_campaign.session_uptime < interval * 60) & (df_with_campaign.session_uptime >= (interval - 1) * 60)].copy()
  5755.     interval_data_0 = interval_data[interval_data.ad_unit_result == 0].shape[0]
  5756.     interval_data_1 = interval_data[interval_data.ad_unit_result == 1].shape[0]
  5757.     interval_data_2 = interval_data[interval_data.ad_unit_result == 2].shape[0]
  5758.     fill_rate_value = interval_data_0 / (interval_data_0 + interval_data_1 + interval_data_2 + 0.0001)
  5759.     fill_rate.append({str(interval): fill_rate_value})
  5760.  
  5761. print(fill_rate)
  5762.  
  5763. ```
  5764.  
  5765.     [{'1': 0.4161072429170326}, {'2': 0.45454462810067614}, {'3': 0.24999965277826003}, {'4': 0.4821419961750068}, {'5': 0.2962957476004674}, {'6': 0.36666605555657406}, {'7': 0.26666607407539095}, {'8': 0.4545440771391601}, {'9': 0.583330902787905}, {'10': 0.41176228375127205}, {'11': 0.3333314814917695}, {'12': 0.09999900000999991}, {'13': 0.47058546714431093}, {'14': 0.4444395062277086}, {'15': 0.5555493827846357}, {'16': 0.6666592593415629}, {'17': 0.4444395062277086}, {'18': 0.33332962967078145}, {'19': 0.49998750031249223}, {'20': 0.5714204082798817}, {'21': 0.28571020413994086}, {'22': 0.49999166680555324}, {'23': 0.249996875039062}, {'24': 0.0}, {'25': 0.0}, {'26': 0.49997500124993743}, {'27': 0.3333222225925802}, {'28': 0.0}, {'29': 0.0}, {'30': 0.0}, {'31': 0.0}, {'32': 0.49997500124993743}, {'33': 0.0}, {'34': 0.9999666677777407}, {'35': 0.0}, {'36': 0.9999500024998749}, {'37': 0.0}, {'38': 0.0}, {'39': 0.0}, {'40': 0.9999000099990001}, {'41': 0.9999666677777407}, {'42': 0.0}, {'43': 0.0}, {'44': 0.9999000099990001}, {'45': 0.0}, {'46': 0.3333222225925802}, {'47': 0.0}, {'48': 0.9999000099990001}, {'49': 0.0}, {'50': 0.0}, {'51': 0.0}, {'52': 0.0}, {'53': 0.9999000099990001}, {'54': 0.0}, {'55': 0.0}, {'56': 0.0}, {'57': 0.0}, {'58': 0.0}, {'59': 0.0}, {'60': 0.9999000099990001}, {'61': 0.0}, {'62': 0.0}, {'63': 0.9999000099990001}, {'64': 0.0}, {'65': 0.9999000099990001}, {'66': 0.0}, {'67': 0.0}, {'68': 0.0}, {'69': 0.0}, {'70': 0.0}, {'71': 0.0}, {'72': 0.0}, {'73': 0.0}, {'74': 0.0}, {'75': 0.0}, {'76': 0.0}, {'77': 0.0}, {'78': 0.0}, {'79': 0.0}, {'80': 0.9999000099990001}, {'81': 0.0}, {'82': 0.9999000099990001}, {'83': 0.0}, {'84': 0.0}, {'85': 0.0}, {'86': 0.0}, {'87': 0.0}, {'88': 0.0}, {'89': 0.0}, {'90': 0.0}, {'91': 0.0}, {'92': 0.0}, {'93': 0.0}, {'94': 0.0}, {'95': 0.0}, {'96': 0.0}, {'97': 0.0}, {'98': 0.0}, {'99': 0.0}]
  5766.  
  5767.  
  5768.  
  5769. ```python
  5770. df_with_campaign.columns
  5771. ```
  5772.  
  5773.  
  5774.  
  5775.  
  5776.     Index(['ad_units', 'request', 'timestamp', 'ad_unit', 'last', 'campaign_id',
  5777.            'stats', 'ad_unit_result', 'ad_unit_start', 'ad_unit_finish',
  5778.            'ad_unit_interval', 'stats_successful', 'lmt', 'model', 'ifa', 'osv',
  5779.            'connectiontype', 'sdk', 'ver', 'consent', 'locale', 'webview_version',
  5780.            'mccmnc', 'ua', 'stats_start', 'stats_finish', 'stats_delta',
  5781.            'session_id', 'session_uuid', 'session_uptime', 'ad_units_with_2'],
  5782.           dtype='object')
  5783.  
  5784.  
  5785.  
  5786.  
  5787. ```python
  5788. def get_amount_ad_unit_with_2(ad_units):
  5789.     ad_units_array = literal_eval(str(ad_units))
  5790.     result = 0
  5791.     for i in ad_units_array:
  5792.         if i['result'] == 2:
  5793.             result += 1
  5794.     return result;
  5795.  
  5796.  
  5797. df_with_campaign["ad_units_with_2"] = df_with_campaign['ad_units'].apply(get_amount_ad_unit_with_2)
  5798.  
  5799. # df_with_campaign.head()
  5800. table = df_with_campaign[df_with_campaign.sdk == "2.5.3"].pivot_table(index='ad_units_with_2', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  5801. table["%"] = table[0] / (table[0] + table[1] + table[2])
  5802. table
  5803.  
  5804. ```
  5805.  
  5806.  
  5807.  
  5808.  
  5809. <div>
  5810. <style scoped>
  5811.     .dataframe tbody tr th:only-of-type {
  5812.         vertical-align: middle;
  5813.     }
  5814.  
  5815.     .dataframe tbody tr th {
  5816.         vertical-align: top;
  5817.     }
  5818.  
  5819.     .dataframe thead th {
  5820.         text-align: right;
  5821.     }
  5822. </style>
  5823. <table border="1" class="dataframe">
  5824.   <thead>
  5825.     <tr style="text-align: right;">
  5826.       <th>ad_unit_result</th>
  5827.       <th>0</th>
  5828.       <th>1</th>
  5829.       <th>2</th>
  5830.       <th>%</th>
  5831.     </tr>
  5832.     <tr>
  5833.       <th>ad_units_with_2</th>
  5834.       <th></th>
  5835.       <th></th>
  5836.       <th></th>
  5837.       <th></th>
  5838.     </tr>
  5839.   </thead>
  5840.   <tbody>
  5841.     <tr>
  5842.       <th>0</th>
  5843.       <td>168</td>
  5844.       <td>0</td>
  5845.       <td>0</td>
  5846.       <td>1.000000</td>
  5847.     </tr>
  5848.     <tr>
  5849.       <th>1</th>
  5850.       <td>29</td>
  5851.       <td>0</td>
  5852.       <td>15</td>
  5853.       <td>0.659091</td>
  5854.     </tr>
  5855.     <tr>
  5856.       <th>2</th>
  5857.       <td>8</td>
  5858.       <td>1</td>
  5859.       <td>11</td>
  5860.       <td>0.400000</td>
  5861.     </tr>
  5862.     <tr>
  5863.       <th>3</th>
  5864.       <td>22</td>
  5865.       <td>0</td>
  5866.       <td>5</td>
  5867.       <td>0.814815</td>
  5868.     </tr>
  5869.     <tr>
  5870.       <th>4</th>
  5871.       <td>7</td>
  5872.       <td>0</td>
  5873.       <td>12</td>
  5874.       <td>0.368421</td>
  5875.     </tr>
  5876.     <tr>
  5877.       <th>5</th>
  5878.       <td>6</td>
  5879.       <td>0</td>
  5880.       <td>13</td>
  5881.       <td>0.315789</td>
  5882.     </tr>
  5883.     <tr>
  5884.       <th>6</th>
  5885.       <td>15</td>
  5886.       <td>0</td>
  5887.       <td>15</td>
  5888.       <td>0.500000</td>
  5889.     </tr>
  5890.     <tr>
  5891.       <th>7</th>
  5892.       <td>2</td>
  5893.       <td>2</td>
  5894.       <td>14</td>
  5895.       <td>0.111111</td>
  5896.     </tr>
  5897.     <tr>
  5898.       <th>8</th>
  5899.       <td>4</td>
  5900.       <td>0</td>
  5901.       <td>12</td>
  5902.       <td>0.250000</td>
  5903.     </tr>
  5904.     <tr>
  5905.       <th>9</th>
  5906.       <td>5</td>
  5907.       <td>0</td>
  5908.       <td>21</td>
  5909.       <td>0.192308</td>
  5910.     </tr>
  5911.     <tr>
  5912.       <th>10</th>
  5913.       <td>1</td>
  5914.       <td>1</td>
  5915.       <td>16</td>
  5916.       <td>0.055556</td>
  5917.     </tr>
  5918.     <tr>
  5919.       <th>11</th>
  5920.       <td>1</td>
  5921.       <td>0</td>
  5922.       <td>37</td>
  5923.       <td>0.026316</td>
  5924.     </tr>
  5925.     <tr>
  5926.       <th>12</th>
  5927.       <td>4</td>
  5928.       <td>0</td>
  5929.       <td>32</td>
  5930.       <td>0.111111</td>
  5931.     </tr>
  5932.     <tr>
  5933.       <th>13</th>
  5934.       <td>3</td>
  5935.       <td>1</td>
  5936.       <td>24</td>
  5937.       <td>0.107143</td>
  5938.     </tr>
  5939.     <tr>
  5940.       <th>14</th>
  5941.       <td>3</td>
  5942.       <td>0</td>
  5943.       <td>32</td>
  5944.       <td>0.085714</td>
  5945.     </tr>
  5946.     <tr>
  5947.       <th>15</th>
  5948.       <td>1</td>
  5949.       <td>0</td>
  5950.       <td>22</td>
  5951.       <td>0.043478</td>
  5952.     </tr>
  5953.     <tr>
  5954.       <th>16</th>
  5955.       <td>1</td>
  5956.       <td>0</td>
  5957.       <td>16</td>
  5958.       <td>0.058824</td>
  5959.     </tr>
  5960.     <tr>
  5961.       <th>17</th>
  5962.       <td>4</td>
  5963.       <td>1</td>
  5964.       <td>25</td>
  5965.       <td>0.133333</td>
  5966.     </tr>
  5967.     <tr>
  5968.       <th>18</th>
  5969.       <td>1</td>
  5970.       <td>0</td>
  5971.       <td>29</td>
  5972.       <td>0.033333</td>
  5973.     </tr>
  5974.     <tr>
  5975.       <th>19</th>
  5976.       <td>0</td>
  5977.       <td>0</td>
  5978.       <td>11</td>
  5979.       <td>0.000000</td>
  5980.     </tr>
  5981.     <tr>
  5982.       <th>20</th>
  5983.       <td>0</td>
  5984.       <td>1</td>
  5985.       <td>3</td>
  5986.       <td>0.000000</td>
  5987.     </tr>
  5988.     <tr>
  5989.       <th>21</th>
  5990.       <td>0</td>
  5991.       <td>0</td>
  5992.       <td>3</td>
  5993.       <td>0.000000</td>
  5994.     </tr>
  5995.     <tr>
  5996.       <th>22</th>
  5997.       <td>0</td>
  5998.       <td>0</td>
  5999.       <td>1</td>
  6000.       <td>0.000000</td>
  6001.     </tr>
  6002.     <tr>
  6003.       <th>23</th>
  6004.       <td>1</td>
  6005.       <td>0</td>
  6006.       <td>0</td>
  6007.       <td>1.000000</td>
  6008.     </tr>
  6009.     <tr>
  6010.       <th>24</th>
  6011.       <td>0</td>
  6012.       <td>0</td>
  6013.       <td>3</td>
  6014.       <td>0.000000</td>
  6015.     </tr>
  6016.     <tr>
  6017.       <th>28</th>
  6018.       <td>0</td>
  6019.       <td>0</td>
  6020.       <td>1</td>
  6021.       <td>0.000000</td>
  6022.     </tr>
  6023.     <tr>
  6024.       <th>29</th>
  6025.       <td>1</td>
  6026.       <td>0</td>
  6027.       <td>2</td>
  6028.       <td>0.333333</td>
  6029.     </tr>
  6030.     <tr>
  6031.       <th>34</th>
  6032.       <td>0</td>
  6033.       <td>0</td>
  6034.       <td>1</td>
  6035.       <td>0.000000</td>
  6036.     </tr>
  6037.     <tr>
  6038.       <th>36</th>
  6039.       <td>0</td>
  6040.       <td>0</td>
  6041.       <td>1</td>
  6042.       <td>0.000000</td>
  6043.     </tr>
  6044.     <tr>
  6045.       <th>37</th>
  6046.       <td>0</td>
  6047.       <td>0</td>
  6048.       <td>1</td>
  6049.       <td>0.000000</td>
  6050.     </tr>
  6051.   </tbody>
  6052. </table>
  6053. </div>
  6054.  
  6055.  
  6056.  
  6057.  
  6058. ```python
  6059. def get_ad_units_amount(ad_units):
  6060.     ad_units_array = literal_eval(str(ad_units))
  6061.     return len(ad_units_array);
  6062.  
  6063.  
  6064. df_with_campaign["ad_units_amount"] = df_with_campaign['ad_units'].apply(get_ad_units_amount)
  6065.  
  6066. # df_with_campaign.head()
  6067. table = df_with_campaign[df_with_campaign.sdk == "2.5.2"].pivot_table(index='ad_units_amount', columns='ad_unit_result', values='timestamp', aggfunc=len, fill_value=0)
  6068. table
  6069.  
  6070. ```
  6071.  
  6072.  
  6073.  
  6074.  
  6075. <div>
  6076. <style scoped>
  6077.     .dataframe tbody tr th:only-of-type {
  6078.         vertical-align: middle;
  6079.     }
  6080.  
  6081.     .dataframe tbody tr th {
  6082.         vertical-align: top;
  6083.     }
  6084.  
  6085.     .dataframe thead th {
  6086.         text-align: right;
  6087.     }
  6088. </style>
  6089. <table border="1" class="dataframe">
  6090.   <thead>
  6091.     <tr style="text-align: right;">
  6092.       <th></th>
  6093.     </tr>
  6094.   </thead>
  6095.   <tbody>
  6096.   </tbody>
  6097. </table>
  6098. </div>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top