morpheus.messages.message_meta.UserMessageMeta

class UserMessageMeta(df, user_id)[source]

Bases: morpheus.messages.message_meta.MessageMeta

This class extends MessageMeta to also hold userid corresponding to batched metadata.

Parameters
dfpandas.DataFrame

Input rows in dataframe.

user_idstr

User id.

Attributes
count

Returns the number of messages in the batch.

df

Methods

ensure_sliceable_index() Replaces the index in the underlying dataframe if the existing one is not unique and monotonic.
get_meta_range(mess_offset, message_count[, ...]) Return column values from morpheus.pipeline.messages.MessageMeta.df from the specified start offset until the message count.
has_sliceable_index() Returns True if the underlying DataFrame's index is unique and monotonic.
copy_dataframe
get_column_names
mutable_dataframe
property count: int

Returns the number of messages in the batch.

Returns
int

number of messages in the MessageMeta.df.

ensure_sliceable_index()[source]

Replaces the index in the underlying dataframe if the existing one is not unique and monotonic. The old index will be preserved in a column named _index_{old_index.name}. If has_sliceable_index() == true, this is a no-op.

Returns
str

The name of the column with the old index or None if no changes were made

get_meta_range(mess_offset, message_count, columns=None)[source]

Return column values from morpheus.pipeline.messages.MessageMeta.df from the specified start offset until the message count.

Parameters
mess_offsetint

Offset into the metadata batch.

message_countint

Messages count.

columnstyping.Union[None, str, typing.List[str]]

Input column names. Returns all columns if None is specified. When a string is passed, a Series is returned. Otherwise a Dataframe is returned.

Returns
Series or Dataframe

Column values from the dataframe.

has_sliceable_index()[source]

Returns True if the underlying DataFrame’s index is unique and monotonic. Sliceable indices have better performance since a range of rows can be specified by a start and stop index instead of requiring boolean masks.

Returns
bool

Previous morpheus.messages.message_meta.MutableTableCtxMgr
Next morpheus.messages.multi_ae_message
© Copyright 2023, NVIDIA. Last updated on Feb 2, 2024.