Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zipcode to mock_customer and docs #417

Merged
merged 11 commits into from Feb 8, 2019
3 changes: 2 additions & 1 deletion docs/source/loading_data/using_entitysets.rst
Expand Up @@ -49,7 +49,8 @@ To get started, we load the transactions dataframe as an entity.
dataframe=transactions_df,
index="transaction_id",
time_index="transaction_time",
variable_types={"product_id": ft.variable_types.Categorical})
variable_types={"product_id": ft.variable_types.Categorical,
"zip_code": ft.variable_types.ZIPCode})
es

.. note ::
Expand Down
5 changes: 2 additions & 3 deletions featuretools/demo/mock_customer.py
Expand Up @@ -7,7 +7,7 @@
from numpy.random import choice

import featuretools as ft
from featuretools.variable_types import Categorical
from featuretools.variable_types import ZIPCode


def load_mock_customer(n_customers=5, n_products=5, n_sessions=35, n_transactions=500,
Expand Down Expand Up @@ -50,7 +50,6 @@ def load_mock_customer(n_customers=5, n_products=5, n_sessions=35, n_transaction

if return_single_table:
return transactions_df.merge(sessions_df).merge(customers_df).merge(products_df).reset_index(drop=True)

elif return_entityset:
es = ft.EntitySet(id="transactions")
es = es.entity_from_dataframe(entity_id="transactions",
Expand All @@ -72,7 +71,7 @@ def load_mock_customer(n_customers=5, n_products=5, n_sessions=35, n_transaction
dataframe=customers_df,
index="customer_id",
time_index="join_date",
variable_types={"zip_code": Categorical})
variable_types={"zip_code": ZIPCode})

rels = [ft.Relationship(es["products"]["product_id"],
es["transactions"]["product_id"]),
Expand Down