util package
add_labels_to_dataframe
Adds labels to a DataFrame based on provided label information.
Parameters
df
labels
label_col_name='label'
convert_json_cbor_to_dataframe
Converts JSON CBOR data to a pandas DataFrame.
Parameters
data
ts_col_name=None
convert_sample_to_dataframe
Converts a sample to a DataFrame and adds labels if provided.
Parameters
sample
label_col_name: Optional[str] = 'label'
ts_col_name: Optional[str] = None
fetch_samples
Fetch samples based on the provided parameters and stream them by their IDs.
Parameters
filename: Optional[str] = None
category: Optional[str] = None
labels: Optional[str] = None
max_workers=None
generate_labels_from_dataframe
Generates structured labels from a DataFrame based on transitions in the specified label column.
This function iterates over the rows of a pandas DataFrame and detects changes in the values of a specified label column. It groups consecutive rows with the same label value, and for each group, it returns a dictionary containing the start index, end index, and the label. Optionally, the result can be returned in a dictionary format, compatible with file saving, including the file name.
Parameters
df
label_col='label'
file_name=None
Last updated