Notebook
pv_df = ws.make_pageview_df(top_news_articles,'en','2013-12-1','2014-12-31') pv_df.to_csv('pageviews_dec.csv',encoding='utf8') pv_df = pv_df.ix[:'2014-12-21'].sort_index(axis=1) pv_df.tail()
non_ipv4_users = list(bp_g_gt1_usernodelist[~bp_g_gt1_usernodelist.index.map(valid_ip)].index) chunks = chunk_maker(non_ipv4_users,50) user_properties = list() for chunk in chunks: user_string = u'|'.join(chunk) props = ws.get_user_properties(user_string,'en') for prop in props['users']: user_properties.append(prop) with open('user_properties.json','wb') as f: json.dump(user_properties,f)