(Latest Version)

morpheus.messages.message_meta.MessageMeta

class MessageMeta(df)[source]

Bases: morpheus.messages.message_base.MessageBase

This is a container class to hold batch deserialized messages metadata.

Parameters
dfpandas.DataFrame

Input rows in dataframe.

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

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.

mess_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

© Copyright 2023, NVIDIA. Last updated on Apr 11, 2023.