In [1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
In [3]:
df = pd.read_csv('~/documents/vinepair/vinepair-posts.csv',parse_dates=True,index_col=None)
In [4]:
df.head(1)
Out[4]:
In [34]:
df['targeted'] = [1 if len(x) > 5 else 0 for x in df['Audience Targeting']]
In [36]:
df.targeted[30:55]
Out[36]:
In [37]:
import seaborn as sns
In [46]:
df_pivoted = df[df.Type == 'Link'].pivot_table(values = 'Lifetime Post Total Reach',columns='targeted')
In [47]:
df_pivoted
Out[47]:
In [ ]: