DW.get_pairs (eng) - datawizio/pythonAPI GitHub Wiki
Returns pairs for categories and products, credibility and support for every pair.
Parameters:
-
date_from: datetime
starting date of period of pairs forming.
-
date_to: datetime
ending date of period of pairs forming.
shops: int, list
-
hours: list [<0...23>, <0...23>, ...]
hours.
-
week_day: int<0...6>, default: "all"
day of the week.
-
product_id: int
id of the product.
-
category_id: int
id of the category.
-
price_from: int, defaul:0
price from.
-
price_to: int, default:10000
price to.
-
pair_by: str, ["category", "product"], default: "category"
forming of pairs for categories or products.
-
map: int, default: 1
level that will be used for counting of accompanying products.
-
show: str, ['id', 'name', 'both'], default: 'id'
returns id, name or both parameters
If the interval [date_from, date_to]
has not been set, last 30 client's days will be used for selection.
If only one parameter has been set, then 30 client's days from selected parameter will be used for selection.
id of the shop or a list of shops.
Returns:
Returns object 'DataFrame' with selection results.
For a parameter show = "id".
0 name | 1 name | ... | N name | <data columns> |
<id> | <id> | ... | <id> | <data> |
...
For a parameter show = "both".
0 name | 0 name_name | ... | N name | N name_name | <data columns> |
<id> | <name> | ... | <id> | <name> | <data> |
In case pair_by = "category", the function forms pairs for categories (or category defined in category_id), pair_by = "product" - for products (or a product defined in product_id).
Examples:
dw = datawiz.DW()
dw.get_pairs(date_from = datetime.date(2015, 10, 1),
date_to = datetime.date(2015, 10, 3),
category_id = 50601,
show = 'both')
As a result we have received pairs for the period from 2015.10.1 till 2015.10.3 for the category 50601, id and name of categories were shown.