Skip to content

Commit

Permalink
Add zipcode to mock_customer and docs (#417)
Browse files Browse the repository at this point in the history
* changed to zipcode type

* fix in docs

* remove suppress

* change docs back
  • Loading branch information
gsheni committed Feb 8, 2019
1 parent 659ebf4 commit 69b6e04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 69b6e04

Please sign in to comment.