Skip to content

← tensor_math package

Unique

Reduce data to its unique values along an axis.

When applied along an axis of a multi-dimensional packet, array, or list of lists, the data is treated as a stack of slices along the given axis, and the data is reduced to the unique slices. Note that the order is by default stable, i.e., the order of appearance is preserved, but this can be overridden. Version 0.8.0

Ports/Properties

data

Data to process.

verbose name
Data
default value
None
port type
DataPort
value type
AnyNumeric (can be None)
data direction
INOUT

axis

Axis along which to reduce the data. For multi-dimensional data, the effect of this is that the array is treated as a stack of slices along the given axis, and the array is reduced to the unique slices. You can also enter the axis label here as in feature.mylabel. For packet data, this axis will be replaced by a generic axis with a label 'unique'.

verbose name
Axis
default value
axis
port type
ComboPort
value type
str (can be None)

order

Order in which to return the unique elements. If set to 'stable', the order of appearance is preserved. If set to 'sorted', the unique elements are sorted (note that for lists of non-numeric data, this mode requires the data to be sortable).

verbose name
Order
default value
stable
port type
EnumPort
value type
str (can be None)

stream

Name of stream to process. Wildcards are supported, so mystream* will process all streams whose name starts with mystream.

verbose name
Stream
default value
None
port type
StringPort
value type
str (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)