From d0211ff3377166cb92e84573325b89b463b78232 Mon Sep 17 00:00:00 2001 From: eliasdabbas Date: Wed, 17 Jan 2018 06:48:06 +0400 Subject: [PATCH] reformat docstring --- advertools/kw_generate.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/advertools/kw_generate.py b/advertools/kw_generate.py index 6d4c087c..29b93706 100644 --- a/advertools/kw_generate.py +++ b/advertools/kw_generate.py @@ -1,14 +1,20 @@ from itertools import permutations +import pandas as pd + def kw_generate(products, words, max_len=3, match_types=['Exact', 'Phrase', 'Broad'], campaign_name='SEM_Campaign'): """Generate a data frame of kewywords using a list of products and relevant words. - `products` will be used as the nams of the ad groups - `words` are any related words that make it clear that the user is interested in `products` - `max_len` is the maximum number of words to include in each permutation to product keywords - `match_types` can be restricted or kept as is based on preference - `campaign_name` name of campaign! + + Parameters + ---------- + + products : will be used as the names of the ad groups + words : related words that make it clear that the user is interested in `products` + max_len : the maximum number of words to include in each permutation of product keywords + match_types : can be restricted or kept as is based on preference + campaign_name : name of campaign >>> products = ['bmw', 'toyota'] >>> words = ['buy', 'second hand'] @@ -20,6 +26,12 @@ def kw_generate(products, words, max_len=3, match_types=['Exact', 'Phrase', 'Bro 2 SEM_Campaign bmw bmw buy Broad 3 SEM_Campaign bmw bmw second hand Exact 4 SEM_Campaign bmw bmw second hand Phrase + + Returns + ------- + + keywords_df : a pandas.DataFrame ready to upload + """ headers = ['Campaign', 'Ad Group', 'Keyword', 'Criterion Type'] keywords_list = []