Skip to main content

a two-dimensional data object with labeled axes and typing information

Project description

Woodwork

Tests Documentation Status PyPI Version Anaconda Version PyPI Downloads


Woodwork provides a common typing namespace for using your existing DataFrames in Featuretools, EvalML, and general ML. A Woodwork DataFrame stores the physical, logical, and semantic data types present in the data. In addition, it can store metadata about the data, allowing you to store specific information you might need for your application.

Installation

Install with pip:

python -m pip install woodwork

or from the conda-forge channel on conda:

conda install -c conda-forge woodwork

Example

Below is an example of using Woodwork. In this example, a sample dataset of order items is used to create a Woodwork DataFrame, specifying the LogicalType for four of the columns.

import pandas as pd
import woodwork as ww

df = pd.read_csv("https://api.featurelabs.com/datasets/online-retail-logs-2018-08-28.csv")
df.ww.init(name='retail', make_index=True, index='order_product_id')
df.ww.set_types(logical_types={
    'quantity': 'Integer',
    'customer_name': 'FullName',
    'country': 'Categorical',
    'order_id': 'Categorical'
})
df.ww
                   Physical Type     Logical Type Semantic Tag(s)
Column                                                           
order_product_id           Int64          Integer       ['index']
order_id                category      Categorical    ['category']
product_id              category      Categorical    ['category']
description               string  NaturalLanguage              []
quantity                   Int64          Integer     ['numeric']
order_date        datetime64[ns]         Datetime              []
unit_price               float64           Double     ['numeric']
customer_name             string         FullName              []
country                 category      Categorical    ['category']
total                    float64           Double     ['numeric']
cancelled                boolean          Boolean              []

We now have initialized Woodwork on the DataFrame with the specified logical types assigned. For columns that did not have a specified logical type value, Woodwork has automatically inferred the logical type based on the underlying data. Additionally, Woodwork has automatically assigned semantic tags to some of the columns, based on the inferred or assigned logical type.

If we wanted to do further analysis on only the columns in this table that have a logical type of Boolean or a semantic tag of numeric we can simply select those columns and access a dataframe containing just those columns:

filtered_df = df.ww.select(include=['Boolean', 'numeric'])
filtered_df
    quantity  unit_price   total  cancelled
0          6      4.2075  25.245      False
1          6      5.5935  33.561      False
2          8      4.5375  36.300      False
3          6      5.5935  33.561      False
4          6      5.5935  33.561      False
..       ...         ...     ...        ...
95         6      4.2075  25.245      False
96       120      0.6930  83.160      False
97        24      0.9075  21.780      False
98        24      0.9075  21.780      False
99        24      0.9075  21.780      False

As you can see, Woodwork makes it easy to manage typing information for your data, and provides simple interfaces to access only the data you need based on the logical types or semantic tags. Please refer to the Woodwork documentation for more detail on working with a Woodwork DataFrame.

Built at Alteryx Innovation Labs

Alteryx Innovation Labs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

woodwork-0.1.0.tar.gz (89.9 kB view details)

Uploaded Source

Built Distribution

woodwork-0.1.0-py3-none-any.whl (108.1 kB view details)

Uploaded Python 3

File details

Details for the file woodwork-0.1.0.tar.gz.

File metadata

  • Download URL: woodwork-0.1.0.tar.gz
  • Upload date:
  • Size: 89.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10

File hashes

Hashes for woodwork-0.1.0.tar.gz
Algorithm Hash digest
SHA256 60f07bc25460569717f153aa90ebc628c17b7f89ae7c6effa7cfea28394a7deb
MD5 f9d650a4ae92e4cec39566bb1c36657b
BLAKE2b-256 af840a056e34d2faabc42c9cb4bc421927d0e14c6d36cc1f190ae56f9d3aabae

See more details on using hashes here.

File details

Details for the file woodwork-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: woodwork-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 108.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10

File hashes

Hashes for woodwork-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29c2ade3dfc8f395073caf1082eb38e08602e82dfdf819f9c4628731399b2190
MD5 db8eb284d3e7b8934da33038f6281255
BLAKE2b-256 d392b56a7915ce88c8331997e5a7bb8c6ec5987f7d2d9f41f8309ccd4a3387ca

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page