ColumnGroup

class nvtabular.column_group.ColumnGroup(columns)[source]

A ColumnGroup is a group of columns that you want to apply the same transformations to. ColumnGroup’s can be transformed by shifting operators on to them, which returns a new ColumnGroup with the transformations applied. This lets you define a graph of operations that makes up your workflow

Parameters

columns (list of (str or tuple of str)) – The columns to select from the input Dataset. The elements of this list are strings indicating the column names in most cases, but can also be tuples of strings for feature crosses.

__add__(other)[source]

Adds columns from this ColumnGroup with another to return a new ColumnGroup

Parameters

other (ColumnGroup or str or list of str) –

Returns

Return type

ColumnGroup

__getitem__(columns)[source]

Selects certain columns from this ColumnGroup, and returns a new Columngroup with only those columns

Parameters

columns (str or list of str) – Columns to select

Returns

Return type

ColumnGroup

__radd__(other)

Adds columns from this ColumnGroup with another to return a new ColumnGroup

Parameters

other (ColumnGroup or str or list of str) –

Returns

Return type

ColumnGroup

__rshift__(operator)[source]

Transforms this ColumnGroup by applying an Operator

Parameters

operators (Operator or callable) –

Returns

Return type

ColumnGroup

__sub__(other)[source]

Removes columns from this ColumnGroup with another to return a new ColumnGroup

Parameters

other (ColumnGroup or str or list of str) – Columns to remove

Returns

Return type

ColumnGroup

__weakref__

list of weak references to the object (if defined)

property input_column_names

Returns the names of columns in the main chain

nvtabular.column_group._merge_add_nodes(graph)[source]

Merges repeat ‘+’ nodes, leading to nicer looking outputs

nvtabular.column_group._to_graphviz(column_group)[source]

Converts a ColumnGroup to a GraphViz DiGraph object useful for display in notebooks