Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "cells": [
- {
- "cell_type": "code",
- "execution_count": 3,
- "metadata": {
- "collapsed": false
- },
- "outputs": [
- {
- "data": {
- "text/html": [
- "<script>jQuery(function() {if (jQuery(\"body.notebook_app\").length == 0) { jQuery(\".input_area\").toggle(); jQuery(\".prompt\").toggle();}});</script>"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<button onclick=\"jQuery('.input_area').toggle(); jQuery('.prompt').toggle();\">Toggle code</button>"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
- "source": [
- "import IPython.core.display as di\n",
- "\n",
- "# This line will hide code by default when the notebook is exported as HTML\n",
- "di.display_html('<script>jQuery(function() {if (jQuery(\"body.notebook_app\").length == 0) { jQuery(\".input_area\").toggle(); jQuery(\".prompt\").toggle();}});</script>', raw=True)\n",
- "\n",
- "# This line will add a button to toggle visibility of code blocks, for use with the HTML export version\n",
- "di.display_html('''<button onclick=\"jQuery('.input_area').toggle(); jQuery('.prompt').toggle();\">Toggle code</button>''', raw=True)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "from IPython.display import display, HTML\n",
- "from itertools import combinations, product"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 5,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "from jarvis.brain.utility.data_preparation import (get_metrics_single_date, get_metrics_date_range)\n",
- "import numpy as np\n",
- "import pandas as pd\n",
- "from sklearn import tree\n",
- "import pydotplus\n",
- "global_metrics = ['ga_cpt', 'fb_spend', 'ga_transactions', 'ga_revenue']\n",
- "goal_metric = 'ga_cpt'"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 6,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "start = '2017-02-21'\n",
- "end = '2017-03-21'\n",
- "df = get_metrics_date_range(15, 'ad', start, end, global_metrics, custom_tags=True, active=False)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 7,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "df= df[df['App Type'] == 'Web']"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 8,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "excluded_tags = ['Campaigns', 'ad_id', 'Image', 'Adsets', 'start_date', '_id', 'Ads',\n",
- " 'end_date', 'Active Ads Count in Adset', 'Active Adsets Count in Campaign', 'Labels', 'audience type', 'audience category', 'Product Set',\n",
- " 'Prominent Text', 'Dominant Color', 'DominantColor', 'ProminentText', 'NumberofFaces', 'Number of Faces', 'Sale', 'name', 'Carousel Count']"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 9,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "def exclude_single_dominant_tag(tags, df):\n",
- " all_tags = []\n",
- " total_spend = df.fb_spend.sum()\n",
- " for tag in tags:\n",
- " grp = df.groupby(tag).sum()\n",
- " grp['prop'] = grp.fb_spend / total_spend\n",
- " if pd.np.max(grp['prop']) > 0.95:\n",
- " print(tag)\n",
- " continue\n",
- " all_tags.append(tag)\n",
- " return all_tags\n",
- "def clean_tags(df, excluded_tags, global_metrics):\n",
- " all_tags = list(set(df.columns) - set(global_metrics) - set(excluded_tags))\n",
- " all_tags = [tag for tag in all_tags if len(df[df[tag] != 'None'][tag].unique()) > 1]\n",
- " all_tags = [tag for tag in all_tags if df[tag].count() > 0.25*len(df)]\n",
- " all_tags = exclude_single_dominant_tag(all_tags, df) \n",
- " return all_tags"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 10,
- "metadata": {
- "collapsed": false
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Call To Action\n",
- "Behaviors\n",
- "Gender\n",
- "Lookalike Types\n",
- "Locations\n",
- "Device Platforms\n",
- "User OS\n",
- "Billing Event\n",
- "Optimization Goal\n"
- ]
- }
- ],
- "source": [
- "all_tags = clean_tags(df, excluded_tags, global_metrics)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Tags after cleanup"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 11,
- "metadata": {
- "collapsed": false
- },
- "outputs": [
- {
- "data": {
- "text/plain": [
- "['Publisher Platforms',\n",
- " 'Facebook Positions',\n",
- " 'Audience Strategy',\n",
- " 'Interests',\n",
- " 'Ad Format',\n",
- " 'Landing Pages',\n",
- " 'Audience Types',\n",
- " 'Custom Audiences',\n",
- " 'Campaign Objective',\n",
- " 'Ad Type',\n",
- " 'Age Range']"
- ]
- },
- "execution_count": 11,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "all_tags"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 13,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "df_org = df.copy()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 14,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "df = df_org[df_org['App Type'] == 'Web']"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 15,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "df_global = df.copy()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 16,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "total_spend = df_global.fb_spend.sum()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 17,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "tag_scores = {}\n",
- "for tag in all_tags:\n",
- " temp = df.groupby([tag]).sum()\n",
- " temp['prop'] = temp['fb_spend'] / total_spend\n",
- " tag_scores[tag] = temp[temp.index != 'None']['prop'].mean()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Scores"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 18,
- "metadata": {
- "collapsed": false
- },
- "outputs": [
- {
- "data": {
- "text/plain": [
- "[('Interests', 0.006639045623801028),\n",
- " ('Custom Audiences', 0.01184565403443271),\n",
- " ('Landing Pages', 0.012984133367588177),\n",
- " ('Age Range', 0.029411764705882373),\n",
- " ('Audience Types', 0.12360931022943827),\n",
- " ('Facebook Positions', 0.1999617738778404),\n",
- " ('Campaign Objective', 0.2000000000000001),\n",
- " ('Publisher Platforms', 0.2499522173473005),\n",
- " ('Ad Type', 0.33325942310142975),\n",
- " ('Ad Format', 0.33325942310142986),\n",
- " ('Audience Strategy', 0.5000000000000001)]"
- ]
- },
- "execution_count": 18,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "import operator\n",
- "sorted(tag_scores.items(), key=operator.itemgetter(1))"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 19,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "score_df = pd.DataFrame().from_dict(tag_scores, orient='index')\n",
- "score_df = score_df.rename(columns = {0:'score'})"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 20,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "score_df = score_df[pd.notnull(score_df['score'])]"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 21,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "num_levels = 4"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 22,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "from sklearn.cluster import KMeans\n",
- "from sklearn import preprocessing\n",
- "\n",
- "train = score_df[pd.notnull(score_df['score'])].values\n",
- "train = preprocessing.scale(train)\n",
- "kmeans_model = KMeans(n_clusters=num_levels, random_state=1).fit(train)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 23,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "score_df['level'] = kmeans_model.labels_"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 24,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "score_levels = {}\n",
- "for level in range(num_levels):\n",
- " score_levels[level] = score_df[score_df['level'] == level]['score'].mean()\n",
- "\n",
- "levels = sorted(score_levels.items(), key=operator.itemgetter(1), reverse=True)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 25,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "global_tag_list = [score_df[score_df['level']==levels[level][0]].index.tolist() for level in range(num_levels)]"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Tag levels"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 26,
- "metadata": {
- "collapsed": false
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Level 1: ['Audience Strategy']\n",
- "Level 2: ['Ad Type', 'Ad Format']\n",
- "Level 3: ['Publisher Platforms', 'Campaign Objective', 'Audience Types', 'Facebook Positions']\n",
- "Level 4: ['Landing Pages', 'Age Range', 'Interests', 'Custom Audiences']\n"
- ]
- }
- ],
- "source": [
- "for level in range(num_levels):\n",
- " print('Level {0}:'.format(level + 1) , global_tag_list[level])"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 27,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "# global_tag_list = ['Campaign Objective']"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 28,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "aggregations = {'fb_spend': pd.np.sum,\n",
- " 'ga_transactions': pd.np.sum,\n",
- " 'ga_revenue': pd.np.sum,\n",
- " }"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 29,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "overall = df_global['fb_spend'].sum() / df_global['ga_transactions'].sum()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 30,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "df_global['ga_cpt'] = df_global['fb_spend'] / df_global['ga_transactions']\n",
- "df_global.replace([pd.np.inf, -pd.np.inf, float('inf')], 0, inplace=True)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 31,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "overall_dev = df_global.ga_cpt.std()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 32,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "P = pd.np.percentile(df_global.fb_spend, [10, 100])"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 33,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "df_global_true = df_global.copy()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 34,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "df_global = df_global#[(df_global.fb_spend >= P[0]) & (df_global.fb_spend <= P[1])]"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 35,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "df_global = df_global[df_global.ga_cpt > 0]"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 44,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "def process_paths(df, tag_list_obj):\n",
- " \n",
- " \n",
- " def recurse_paths(tag_list, tag_list_old, tag_values_old):\n",
- " if len(tag_list):\n",
- " tag_level = tag_list.pop(0)\n",
- "\n",
- " tags = []\n",
- " if isinstance(tag_level, list):\n",
- " tags = tags + tag_level\n",
- " else:\n",
- " tags = tags + [tag_level]\n",
- " \n",
- " if len(tag_list_old):\n",
- " old = df.groupby(tag_list_old).agg(aggregations)\n",
- " old['ga_cpt'] = old['fb_spend'] / old['ga_transactions']\n",
- " old_cpt = old.loc[tag_values_old]['ga_cpt']\n",
- " old_spend = old.loc[tag_values_old]['fb_spend']\n",
- " else:\n",
- " old = df\n",
- " old_cpt = old.fb_spend.sum() / old.ga_transactions.sum()\n",
- " old_spend = old.fb_spend.sum()\n",
- "\n",
- " premature = True\n",
- " for tag in tags:\n",
- " new_tag_list = tag_list_old + [tag]\n",
- "\n",
- " new = df.groupby(new_tag_list).agg(aggregations)\n",
- " new['ga_cpt'] = new['fb_spend'] / new['ga_transactions']\n",
- " prop = new['fb_spend'] / old_spend\n",
- " \n",
- " if pd.np.max(prop) > 0.95:\n",
- " continue\n",
- " \n",
- " tag_values = set([val[-1] if isinstance(val, tuple) else val for val in new.index.values.tolist()] )\n",
- "\n",
- " if (tag_values == ['None']):\n",
- " continue\n",
- "\n",
- " for value in tag_values:\n",
- " if value == 'None':\n",
- " continue\n",
- " new_tag_value = tag_values_old + (value,)\n",
- " try:\n",
- " new.loc[new_tag_value]\n",
- " except:\n",
- " continue\n",
- " if True:#(new.loc[new_tag_value].fb_spend >= P[0]) & (new.loc[new_tag_value].fb_spend <= P[1]):\n",
- " value_df = new.loc[new_tag_value]\n",
- " bad_condition = (((value_df.fb_spend / value_df.ga_transactions) - old_cpt) / old_cpt ) > 0.2\n",
- " good_condition = (((value_df.fb_spend / value_df.ga_transactions) - old_cpt) / old_cpt )< -0.2\n",
- " if bad_condition:\n",
- " bad[new_tag_value] = {'cpt': value_df.fb_spend / value_df.ga_transactions,\n",
- " 'spend_prop': value_df.fb_spend*100 / df_global.fb_spend.sum(),\n",
- " 'tag_list': new_tag_list}\n",
- " \n",
- " if good_condition:\n",
- " good[new_tag_value] = {'cpt': value_df.fb_spend / value_df.ga_transactions,\n",
- " 'spend_prop': value_df.fb_spend*100 / df_global.fb_spend.sum(),\n",
- " 'tag_list': new_tag_list} \n",
- " \n",
- " premature = False\n",
- " recurse_paths(tag_list[:], new_tag_list[:], new_tag_value[:])\n",
- " \n",
- " if premature and len(tag_list):\n",
- " recurse_paths(tag_list[:], tag_list_old, tag_values_old)\n",
- " \n",
- " recurse_paths(tag_list_obj, [], ())"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 45,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": [
- "bad = {}\n",
- "good = {}"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 46,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "tag_list = global_tag_list\n",
- "process_paths(df_global, tag_list[:])\n",
- "bad_raw = bad.copy()\n",
- "good_raw = good.copy()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 49,
- "metadata": {
- "collapsed": false
- },
- "outputs": [],
- "source": [
- "def get_filtered_paths(paths):\n",
- " filtered_paths = {key: value for (key, value) in paths.items() if value['spend_prop'] > 2}\n",
- "\n",
- " processed_paths = {}\n",
- " for key, value in filtered_paths.items():\n",
- " l = list(key)\n",
- " none_list = ['-']*len(tag_list)\n",
- " none_list[:len(l)] = l\n",
- " if len(none_list) > 1:\n",
- " new_key = tuple(none_list)\n",
- " else:\n",
- " new_key = none_list[0]\n",
- "\n",
- " if tuple(value['tag_list']) in processed_paths:\n",
- " processed_paths[tuple(value['tag_list'])][new_key] = {metric: val for metric, val in value.items() if metric != 'tag_list'}\n",
- " else:\n",
- " processed_paths[tuple(value['tag_list'])] = {}\n",
- " processed_paths[tuple(value['tag_list'])][new_key] = {metric: val for metric, val in value.items() if metric != 'tag_list'}\n",
- "\n",
- " impact_values = {}\n",
- " for key, value in processed_paths.items():\n",
- " out_df = pd.DataFrame().from_dict(value, orient='index')\n",
- " impact = out_df.cpt.mean()*out_df.spend_prop.mean()\n",
- " impact_values[key] = impact\n",
- "\n",
- " impacts = sorted(impact_values.items(), key=operator.itemgetter(1), reverse=True)\n",
- " \n",
- " return processed_paths, impacts"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Bad paths"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 50,
- "metadata": {
- "collapsed": false,
- "scrolled": false
- },
- "outputs": [
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Publisher Platforms</th>\n",
- " <th>Landing Pages</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"3\" valign=\"top\">Retention</th>\n",
- " <th rowspan=\"3\" valign=\"top\">Carousel</th>\n",
- " <th rowspan=\"3\" valign=\"top\">facebook</th>\n",
- " <th>www.zivame.com</th>\n",
- " <td>3.055746</td>\n",
- " <td>1438.573941</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>www.zivame.com/no-sag-flat-30.html</th>\n",
- " <td>2.256079</td>\n",
- " <td>1507.750070</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>www.zivame.com/nov-buy-1-get-1-free.html</th>\n",
- " <td>2.062589</td>\n",
- " <td>1350.115411</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Type Publisher Platforms Landing Pages \n",
- "Retention Carousel facebook www.zivame.com 3.055746 \n",
- " www.zivame.com/no-sag-flat-30.html 2.256079 \n",
- " www.zivame.com/nov-buy-1-get-1-free.html 2.062589 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Type Publisher Platforms Landing Pages \n",
- "Retention Carousel facebook www.zivame.com 1438.573941 \n",
- " www.zivame.com/no-sag-flat-30.html 1507.750070 \n",
- " www.zivame.com/nov-buy-1-get-1-free.html 1350.115411 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Audience Types</th>\n",
- " <th>Custom Audiences</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Carousel</th>\n",
- " <th>Custom</th>\n",
- " <th>shapewear buyers</th>\n",
- " <td>2.975907</td>\n",
- " <td>1597.755618</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Type Audience Types Custom Audiences \n",
- "Retention Carousel Custom shapewear buyers 2.975907 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Type Audience Types Custom Audiences \n",
- "Retention Carousel Custom shapewear buyers 1597.755618 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Format</th>\n",
- " <th>Facebook Positions</th>\n",
- " <th>Age Range</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Image</th>\n",
- " <th>feed</th>\n",
- " <th>23-54</th>\n",
- " <td>2.791431</td>\n",
- " <td>1240.793349</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Format Facebook Positions Age Range \n",
- "Retention Image feed 23-54 2.791431 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Format Facebook Positions Age Range \n",
- "Retention Image feed 23-54 1240.793349 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Format</th>\n",
- " <th>Publisher Platforms</th>\n",
- " <th>Age Range</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Image</th>\n",
- " <th>facebook</th>\n",
- " <th>23-54</th>\n",
- " <td>2.791431</td>\n",
- " <td>1240.793349</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Format Publisher Platforms Age Range \n",
- "Retention Image facebook 23-54 2.791431 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Format Publisher Platforms Age Range \n",
- "Retention Image facebook 23-54 1240.793349 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Publisher Platforms</th>\n",
- " <th>Age Range</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Carousel</th>\n",
- " <th>facebook</th>\n",
- " <th>23-54</th>\n",
- " <td>2.839474</td>\n",
- " <td>1250.515714</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Type Publisher Platforms Age Range \n",
- "Retention Carousel facebook 23-54 2.839474 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Type Publisher Platforms Age Range \n",
- "Retention Carousel facebook 23-54 1250.515714 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Facebook Positions</th>\n",
- " <th>Custom Audiences</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"3\" valign=\"top\">Retention</th>\n",
- " <th rowspan=\"3\" valign=\"top\">Carousel</th>\n",
- " <th rowspan=\"3\" valign=\"top\">feed</th>\n",
- " <th>Rem_AllBrasExclPadded_30_2</th>\n",
- " <td>3.341379</td>\n",
- " <td>1252.265843</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>avg value 500-1000</th>\n",
- " <td>3.206305</td>\n",
- " <td>1292.907553</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>shapewear buyers</th>\n",
- " <td>2.975907</td>\n",
- " <td>1597.755618</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Type Facebook Positions Custom Audiences \n",
- "Retention Carousel feed Rem_AllBrasExclPadded_30_2 3.341379 \n",
- " avg value 500-1000 3.206305 \n",
- " shapewear buyers 2.975907 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Type Facebook Positions Custom Audiences \n",
- "Retention Carousel feed Rem_AllBrasExclPadded_30_2 1252.265843 \n",
- " avg value 500-1000 1292.907553 \n",
- " shapewear buyers 1597.755618 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Format</th>\n",
- " <th>Facebook Positions</th>\n",
- " <th>Landing Pages</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"3\" valign=\"top\">Retention</th>\n",
- " <th rowspan=\"3\" valign=\"top\">Image</th>\n",
- " <th rowspan=\"3\" valign=\"top\">feed</th>\n",
- " <th>www.zivame.com</th>\n",
- " <td>2.833776</td>\n",
- " <td>1417.892251</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>www.zivame.com/no-sag-flat-30.html</th>\n",
- " <td>2.256079</td>\n",
- " <td>1507.750070</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>www.zivame.com/nov-buy-1-get-1-free.html</th>\n",
- " <td>2.062589</td>\n",
- " <td>1350.115411</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Format Facebook Positions Landing Pages \n",
- "Retention Image feed www.zivame.com 2.833776 \n",
- " www.zivame.com/no-sag-flat-30.html 2.256079 \n",
- " www.zivame.com/nov-buy-1-get-1-free.html 2.062589 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Format Facebook Positions Landing Pages \n",
- "Retention Image feed www.zivame.com 1417.892251 \n",
- " www.zivame.com/no-sag-flat-30.html 1507.750070 \n",
- " www.zivame.com/nov-buy-1-get-1-free.html 1350.115411 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Format</th>\n",
- " <th>Publisher Platforms</th>\n",
- " <th>Landing Pages</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"3\" valign=\"top\">Retention</th>\n",
- " <th rowspan=\"3\" valign=\"top\">Image</th>\n",
- " <th rowspan=\"3\" valign=\"top\">facebook</th>\n",
- " <th>www.zivame.com</th>\n",
- " <td>2.833776</td>\n",
- " <td>1417.892251</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>www.zivame.com/no-sag-flat-30.html</th>\n",
- " <td>2.256079</td>\n",
- " <td>1507.750070</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>www.zivame.com/nov-buy-1-get-1-free.html</th>\n",
- " <td>2.062589</td>\n",
- " <td>1350.115411</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Format Publisher Platforms Landing Pages \n",
- "Retention Image facebook www.zivame.com 2.833776 \n",
- " www.zivame.com/no-sag-flat-30.html 2.256079 \n",
- " www.zivame.com/nov-buy-1-get-1-free.html 2.062589 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Format Publisher Platforms Landing Pages \n",
- "Retention Image facebook www.zivame.com 1417.892251 \n",
- " www.zivame.com/no-sag-flat-30.html 1507.750070 \n",
- " www.zivame.com/nov-buy-1-get-1-free.html 1350.115411 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Audience Types</th>\n",
- " <th>Landing Pages</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Carousel</th>\n",
- " <th>Custom</th>\n",
- " <th>www.zivame.com</th>\n",
- " <td>2.032741</td>\n",
- " <td>1438.995407</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Type Audience Types Landing Pages \n",
- "Retention Carousel Custom www.zivame.com 2.032741 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Type Audience Types Landing Pages \n",
- "Retention Carousel Custom www.zivame.com 1438.995407 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Format</th>\n",
- " <th>Facebook Positions</th>\n",
- " <th>Custom Audiences</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"3\" valign=\"top\">Retention</th>\n",
- " <th rowspan=\"3\" valign=\"top\">Image</th>\n",
- " <th rowspan=\"3\" valign=\"top\">feed</th>\n",
- " <th>Rem_AllBrasExclPadded_30_2</th>\n",
- " <td>3.314888</td>\n",
- " <td>1252.158577</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>avg value 500-1000</th>\n",
- " <td>3.206305</td>\n",
- " <td>1292.907553</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>shapewear buyers</th>\n",
- " <td>2.975907</td>\n",
- " <td>1597.755618</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Format Facebook Positions Custom Audiences \n",
- "Retention Image feed Rem_AllBrasExclPadded_30_2 3.314888 \n",
- " avg value 500-1000 3.206305 \n",
- " shapewear buyers 2.975907 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Format Facebook Positions Custom Audiences \n",
- "Retention Image feed Rem_AllBrasExclPadded_30_2 1252.158577 \n",
- " avg value 500-1000 1292.907553 \n",
- " shapewear buyers 1597.755618 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Format</th>\n",
- " <th>Audience Types</th>\n",
- " <th>-</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Image</th>\n",
- " <th>Combination</th>\n",
- " <th>-</th>\n",
- " <td>6.163229</td>\n",
- " <td>1272.15013</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop cpt\n",
- "Audience Strategy Ad Format Audience Types - \n",
- "Retention Image Combination - 6.163229 1272.15013"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Format</th>\n",
- " <th>Publisher Platforms</th>\n",
- " <th>Custom Audiences</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"3\" valign=\"top\">Retention</th>\n",
- " <th rowspan=\"3\" valign=\"top\">Image</th>\n",
- " <th rowspan=\"3\" valign=\"top\">facebook</th>\n",
- " <th>Rem_AllBrasExclPadded_30_2</th>\n",
- " <td>3.314888</td>\n",
- " <td>1252.158577</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>avg value 500-1000</th>\n",
- " <td>3.206305</td>\n",
- " <td>1292.907553</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>shapewear buyers</th>\n",
- " <td>2.975907</td>\n",
- " <td>1597.755618</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Format Publisher Platforms Custom Audiences \n",
- "Retention Image facebook Rem_AllBrasExclPadded_30_2 3.314888 \n",
- " avg value 500-1000 3.206305 \n",
- " shapewear buyers 2.975907 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Format Publisher Platforms Custom Audiences \n",
- "Retention Image facebook Rem_AllBrasExclPadded_30_2 1252.158577 \n",
- " avg value 500-1000 1292.907553 \n",
- " shapewear buyers 1597.755618 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Publisher Platforms</th>\n",
- " <th>Custom Audiences</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"3\" valign=\"top\">Retention</th>\n",
- " <th rowspan=\"3\" valign=\"top\">Carousel</th>\n",
- " <th rowspan=\"3\" valign=\"top\">facebook</th>\n",
- " <th>Rem_AllBrasExclPadded_30_2</th>\n",
- " <td>3.341379</td>\n",
- " <td>1252.265843</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>avg value 500-1000</th>\n",
- " <td>3.206305</td>\n",
- " <td>1292.907553</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>shapewear buyers</th>\n",
- " <td>2.975907</td>\n",
- " <td>1597.755618</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Type Publisher Platforms Custom Audiences \n",
- "Retention Carousel facebook Rem_AllBrasExclPadded_30_2 3.341379 \n",
- " avg value 500-1000 3.206305 \n",
- " shapewear buyers 2.975907 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Type Publisher Platforms Custom Audiences \n",
- "Retention Carousel facebook Rem_AllBrasExclPadded_30_2 1252.265843 \n",
- " avg value 500-1000 1292.907553 \n",
- " shapewear buyers 1597.755618 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Facebook Positions</th>\n",
- " <th>Age Range</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Carousel</th>\n",
- " <th>feed</th>\n",
- " <th>23-54</th>\n",
- " <td>2.839474</td>\n",
- " <td>1250.515714</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Type Facebook Positions Age Range \n",
- "Retention Carousel feed 23-54 2.839474 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Type Facebook Positions Age Range \n",
- "Retention Carousel feed 23-54 1250.515714 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Facebook Positions</th>\n",
- " <th>Landing Pages</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"3\" valign=\"top\">Retention</th>\n",
- " <th rowspan=\"3\" valign=\"top\">Carousel</th>\n",
- " <th rowspan=\"3\" valign=\"top\">feed</th>\n",
- " <th>www.zivame.com</th>\n",
- " <td>3.055746</td>\n",
- " <td>1438.573941</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>www.zivame.com/no-sag-flat-30.html</th>\n",
- " <td>2.256079</td>\n",
- " <td>1507.750070</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>www.zivame.com/nov-buy-1-get-1-free.html</th>\n",
- " <td>2.062589</td>\n",
- " <td>1350.115411</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Type Facebook Positions Landing Pages \n",
- "Retention Carousel feed www.zivame.com 3.055746 \n",
- " www.zivame.com/no-sag-flat-30.html 2.256079 \n",
- " www.zivame.com/nov-buy-1-get-1-free.html 2.062589 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Type Facebook Positions Landing Pages \n",
- "Retention Carousel feed www.zivame.com 1438.573941 \n",
- " www.zivame.com/no-sag-flat-30.html 1507.750070 \n",
- " www.zivame.com/nov-buy-1-get-1-free.html 1350.115411 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Audience Types</th>\n",
- " <th>-</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Carousel</th>\n",
- " <th>Combination</th>\n",
- " <th>-</th>\n",
- " <td>6.18972</td>\n",
- " <td>1272.122968</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop cpt\n",
- "Audience Strategy Ad Type Audience Types - \n",
- "Retention Carousel Combination - 6.18972 1272.122968"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Format</th>\n",
- " <th>Audience Types</th>\n",
- " <th>Custom Audiences</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Image</th>\n",
- " <th>Custom</th>\n",
- " <th>shapewear buyers</th>\n",
- " <td>2.975907</td>\n",
- " <td>1597.755618</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Format Audience Types Custom Audiences \n",
- "Retention Image Custom shapewear buyers 2.975907 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Format Audience Types Custom Audiences \n",
- "Retention Image Custom shapewear buyers 1597.755618 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
- "source": [
- "bad_new, bad_impacts = get_filtered_paths(bad_raw)\n",
- "bad_impacts_list = [value[0] for value in bad_impacts]\n",
- "for key, value in bad_new.items():\n",
- " if key in bad_impacts_list[0:]:\n",
- " b = pd.DataFrame().from_dict(value, orient='index')\n",
- " none_list = ['-']*len(tag_list)\n",
- " l = list(key)\n",
- " none_list[:len(l)] = l\n",
- "\n",
- " b.index = b.index.set_names(none_list)\n",
- "\n",
- " display(b)\n",
- " "
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Good Paths"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 51,
- "metadata": {
- "collapsed": false,
- "scrolled": false
- },
- "outputs": [
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Publisher Platforms</th>\n",
- " <th>Landing Pages</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"2\" valign=\"top\">Retention</th>\n",
- " <th rowspan=\"2\" valign=\"top\">Carousel</th>\n",
- " <th rowspan=\"2\" valign=\"top\">facebook</th>\n",
- " <th>www.zivame.com/holi-special-half-price.html</th>\n",
- " <td>3.466346</td>\n",
- " <td>610.074862</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>www.zivame.com/panties/tummy-tucker-shaping-panties.html</th>\n",
- " <td>3.481535</td>\n",
- " <td>518.258879</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Type Publisher Platforms Landing Pages \n",
- "Retention Carousel facebook www.zivame.com/holi-special-half-price.html 3.466346 \n",
- " www.zivame.com/panties/tummy-tucker-shaping-pan... 3.481535 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Type Publisher Platforms Landing Pages \n",
- "Retention Carousel facebook www.zivame.com/holi-special-half-price.html 610.074862 \n",
- " www.zivame.com/panties/tummy-tucker-shaping-pan... 518.258879 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Audience Types</th>\n",
- " <th>-</th>\n",
- " <th>-</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Prospecting</th>\n",
- " <th>Lookalike</th>\n",
- " <th>-</th>\n",
- " <th>-</th>\n",
- " <td>11.831786</td>\n",
- " <td>1005.098916</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop cpt\n",
- "Audience Strategy Audience Types - - \n",
- "Prospecting Lookalike - - 11.831786 1005.098916"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Facebook Positions</th>\n",
- " <th>Landing Pages</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"2\" valign=\"top\">Retention</th>\n",
- " <th rowspan=\"2\" valign=\"top\">Carousel</th>\n",
- " <th rowspan=\"2\" valign=\"top\">feed</th>\n",
- " <th>www.zivame.com/holi-special-half-price.html</th>\n",
- " <td>3.466346</td>\n",
- " <td>610.074862</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>www.zivame.com/panties/tummy-tucker-shaping-panties.html</th>\n",
- " <td>3.481535</td>\n",
- " <td>518.258879</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Type Facebook Positions Landing Pages \n",
- "Retention Carousel feed www.zivame.com/holi-special-half-price.html 3.466346 \n",
- " www.zivame.com/panties/tummy-tucker-shaping-pan... 3.481535 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Type Facebook Positions Landing Pages \n",
- "Retention Carousel feed www.zivame.com/holi-special-half-price.html 610.074862 \n",
- " www.zivame.com/panties/tummy-tucker-shaping-pan... 518.258879 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Audience Types</th>\n",
- " <th>Landing Pages</th>\n",
- " <th>-</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"2\" valign=\"top\">Prospecting</th>\n",
- " <th>Lookalike</th>\n",
- " <th>www.zivame.com/panties/tummy-tucker-shaping-panties.html</th>\n",
- " <th>-</th>\n",
- " <td>4.212631</td>\n",
- " <td>691.737766</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Open Targeting</th>\n",
- " <th>www.zivame.com/no-sag-flat-30.html</th>\n",
- " <th>-</th>\n",
- " <td>2.477530</td>\n",
- " <td>1033.938079</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Audience Types Landing Pages - \n",
- "Prospecting Lookalike www.zivame.com/panties/tummy-tucker-shaping-pan... - 4.212631 \n",
- " Open Targeting www.zivame.com/no-sag-flat-30.html - 2.477530 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Audience Types Landing Pages - \n",
- "Prospecting Lookalike www.zivame.com/panties/tummy-tucker-shaping-pan... - 691.737766 \n",
- " Open Targeting www.zivame.com/no-sag-flat-30.html - 1033.938079 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Format</th>\n",
- " <th>Audience Types</th>\n",
- " <th>Landing Pages</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"2\" valign=\"top\">Retention</th>\n",
- " <th rowspan=\"2\" valign=\"top\">Image</th>\n",
- " <th rowspan=\"2\" valign=\"top\">Custom</th>\n",
- " <th>www.zivame.com/holi-special-half-price.html</th>\n",
- " <td>2.168894</td>\n",
- " <td>630.018693</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>www.zivame.com/panties/tummy-tucker-shaping-panties.html</th>\n",
- " <td>2.363914</td>\n",
- " <td>514.610046</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Format Audience Types Landing Pages \n",
- "Retention Image Custom www.zivame.com/holi-special-half-price.html 2.168894 \n",
- " www.zivame.com/panties/tummy-tucker-shaping-pan... 2.363914 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Format Audience Types Landing Pages \n",
- "Retention Image Custom www.zivame.com/holi-special-half-price.html 630.018693 \n",
- " www.zivame.com/panties/tummy-tucker-shaping-pan... 514.610046 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Facebook Positions</th>\n",
- " <th>Custom Audiences</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Carousel</th>\n",
- " <th>feed</th>\n",
- " <th>o2</th>\n",
- " <td>5.866635</td>\n",
- " <td>740.63498</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Type Facebook Positions Custom Audiences \n",
- "Retention Carousel feed o2 5.866635 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Type Facebook Positions Custom Audiences \n",
- "Retention Carousel feed o2 740.63498 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Format</th>\n",
- " <th>Facebook Positions</th>\n",
- " <th>Landing Pages</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"2\" valign=\"top\">Retention</th>\n",
- " <th rowspan=\"2\" valign=\"top\">Image</th>\n",
- " <th rowspan=\"2\" valign=\"top\">feed</th>\n",
- " <th>www.zivame.com/holi-special-half-price.html</th>\n",
- " <td>3.466346</td>\n",
- " <td>610.074862</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>www.zivame.com/panties/tummy-tucker-shaping-panties.html</th>\n",
- " <td>3.481535</td>\n",
- " <td>518.258879</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Format Facebook Positions Landing Pages \n",
- "Retention Image feed www.zivame.com/holi-special-half-price.html 3.466346 \n",
- " www.zivame.com/panties/tummy-tucker-shaping-pan... 3.481535 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Format Facebook Positions Landing Pages \n",
- "Retention Image feed www.zivame.com/holi-special-half-price.html 610.074862 \n",
- " www.zivame.com/panties/tummy-tucker-shaping-pan... 518.258879 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Format</th>\n",
- " <th>Publisher Platforms</th>\n",
- " <th>Landing Pages</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"2\" valign=\"top\">Retention</th>\n",
- " <th rowspan=\"2\" valign=\"top\">Image</th>\n",
- " <th rowspan=\"2\" valign=\"top\">facebook</th>\n",
- " <th>www.zivame.com/holi-special-half-price.html</th>\n",
- " <td>3.466346</td>\n",
- " <td>610.074862</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>www.zivame.com/panties/tummy-tucker-shaping-panties.html</th>\n",
- " <td>3.481535</td>\n",
- " <td>518.258879</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Format Publisher Platforms Landing Pages \n",
- "Retention Image facebook www.zivame.com/holi-special-half-price.html 3.466346 \n",
- " www.zivame.com/panties/tummy-tucker-shaping-pan... 3.481535 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Format Publisher Platforms Landing Pages \n",
- "Retention Image facebook www.zivame.com/holi-special-half-price.html 610.074862 \n",
- " www.zivame.com/panties/tummy-tucker-shaping-pan... 518.258879 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Audience Types</th>\n",
- " <th>Landing Pages</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th rowspan=\"2\" valign=\"top\">Retention</th>\n",
- " <th rowspan=\"2\" valign=\"top\">Carousel</th>\n",
- " <th rowspan=\"2\" valign=\"top\">Custom</th>\n",
- " <th>www.zivame.com/holi-special-half-price.html</th>\n",
- " <td>2.168894</td>\n",
- " <td>630.018693</td>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>www.zivame.com/panties/tummy-tucker-shaping-panties.html</th>\n",
- " <td>2.363914</td>\n",
- " <td>514.610046</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Type Audience Types Landing Pages \n",
- "Retention Carousel Custom www.zivame.com/holi-special-half-price.html 2.168894 \n",
- " www.zivame.com/panties/tummy-tucker-shaping-pan... 2.363914 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Type Audience Types Landing Pages \n",
- "Retention Carousel Custom www.zivame.com/holi-special-half-price.html 630.018693 \n",
- " www.zivame.com/panties/tummy-tucker-shaping-pan... 514.610046 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Format</th>\n",
- " <th>Facebook Positions</th>\n",
- " <th>Custom Audiences</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Image</th>\n",
- " <th>feed</th>\n",
- " <th>o2</th>\n",
- " <td>5.761855</td>\n",
- " <td>732.243537</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Format Facebook Positions Custom Audiences \n",
- "Retention Image feed o2 5.761855 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Format Facebook Positions Custom Audiences \n",
- "Retention Image feed o2 732.243537 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Format</th>\n",
- " <th>Publisher Platforms</th>\n",
- " <th>Custom Audiences</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Image</th>\n",
- " <th>facebook</th>\n",
- " <th>o2</th>\n",
- " <td>6.273405</td>\n",
- " <td>764.712691</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Format Publisher Platforms Custom Audiences \n",
- "Retention Image facebook o2 6.273405 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Format Publisher Platforms Custom Audiences \n",
- "Retention Image facebook o2 764.712691 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Publisher Platforms</th>\n",
- " <th>Custom Audiences</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Carousel</th>\n",
- " <th>facebook</th>\n",
- " <th>o2</th>\n",
- " <td>6.378185</td>\n",
- " <td>772.558035</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Type Publisher Platforms Custom Audiences \n",
- "Retention Carousel facebook o2 6.378185 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Type Publisher Platforms Custom Audiences \n",
- "Retention Carousel facebook o2 772.558035 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Type</th>\n",
- " <th>Audience Types</th>\n",
- " <th>Custom Audiences</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Carousel</th>\n",
- " <th>Custom</th>\n",
- " <th>o2</th>\n",
- " <td>6.378185</td>\n",
- " <td>772.558035</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Type Audience Types Custom Audiences \n",
- "Retention Carousel Custom o2 6.378185 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Type Audience Types Custom Audiences \n",
- "Retention Carousel Custom o2 772.558035 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "<div>\n",
- "<table border=\"1\" class=\"dataframe\">\n",
- " <thead>\n",
- " <tr style=\"text-align: right;\">\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " <th>spend_prop</th>\n",
- " <th>cpt</th>\n",
- " </tr>\n",
- " <tr>\n",
- " <th>Audience Strategy</th>\n",
- " <th>Ad Format</th>\n",
- " <th>Audience Types</th>\n",
- " <th>Custom Audiences</th>\n",
- " <th></th>\n",
- " <th></th>\n",
- " </tr>\n",
- " </thead>\n",
- " <tbody>\n",
- " <tr>\n",
- " <th>Retention</th>\n",
- " <th>Image</th>\n",
- " <th>Custom</th>\n",
- " <th>o2</th>\n",
- " <td>6.273405</td>\n",
- " <td>764.712691</td>\n",
- " </tr>\n",
- " </tbody>\n",
- "</table>\n",
- "</div>"
- ],
- "text/plain": [
- " spend_prop \\\n",
- "Audience Strategy Ad Format Audience Types Custom Audiences \n",
- "Retention Image Custom o2 6.273405 \n",
- "\n",
- " cpt \n",
- "Audience Strategy Ad Format Audience Types Custom Audiences \n",
- "Retention Image Custom o2 764.712691 "
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
- "source": [
- "good_new, good_impacts = get_filtered_paths(good_raw)\n",
- "good_impacts_list = [value[0] for value in good_impacts]\n",
- "for key, value in good_new.items():\n",
- " if key in good_impacts_list[0:]:\n",
- " b = pd.DataFrame().from_dict(value, orient='index')\n",
- " none_list = ['-']*len(tag_list)\n",
- " l = list(key)\n",
- " none_list[:len(l)] = l\n",
- "\n",
- " b.index = b.index.set_names(none_list)\n",
- "\n",
- " display(b)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "anaconda-cloud": {},
- "kernelspec": {
- "display_name": "Python [jarvis1]",
- "language": "python",
- "name": "Python [jarvis1]"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.5.2"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement