Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save WillKoehrsen/a86e3e7e367506114a503b7db4dd0639 to your computer and use it in GitHub Desktop.
Save WillKoehrsen/a86e3e7e367506114a503b7db4dd0639 to your computer and use it in GitHub Desktop.
import featuretools as ft
def entityset_from_partition(path):
"""Create an EntitySet from a partition of data"""
# Read in data from path
app = pd.read_csv('%s/app.csv' % path)
... # Read in 6 other files
# Create the entityset and add tables and relationships
es = ft.EntitySet(id = 'clients')
es = es.entity_from_dataframe('app', dataframe = app, ...)
... # Add the other 6 tables
relationship_one = ft.Relationship(...)
... # Add in 5 other relationships
es = es.add_relationships([relationship_one, ...])
...# Add in interesting values if necessary
return es
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment