Skip to content

feature_table

feature_table ¤

DescriptiveFeatures ¤

DescriptiveFeatures(dataframe: DataFrame)

Compute descriptive statistics for a DataFrame, grouped by UUID.

Use compute to get descriptive statistics for each UUID in the DataFrame.

Attributes:

Name Type Description
data DataFrame

DataFrame containing the data.

Initialize with the DataFrame to describe.

Parameters:

Name Type Description Default
dataframe DataFrame

DataFrame containing the data.

required

overall_stats ¤

overall_stats(group: DataFrame) -> dict[str, int | float]

Compute and return overall statistics for the DataFrame group.

The returned dictionary contains:

  • total_rows: Total number of rows in the group.
  • total_time: Total time difference from max and min of 'systime' column.
  • is_delta_sum: Sum of the 'is_delta' column.
  • is_delta_avg: Mean of the 'is_delta' column.
  • is_delta_std: Standard deviation of the 'is_delta' column.

The is_delta_* values are NaN when the group has no is_delta column (or no value in it).

Parameters:

Name Type Description Default
group DataFrame

DataFrame group (rows of a single UUID) to summarize.

required

Returns:

Name Type Description
dict dict[str, int | float]

A dictionary with overall statistics.

compute_per_group ¤

compute_per_group(
    group: DataFrame,
) -> dict[str, dict[str, Any]]

Compute and return statistics for each column in the DataFrame group.

Parameters:

Name Type Description Default
group DataFrame

DataFrame group (rows of a single UUID) to summarize.

required

Returns:

Name Type Description
dict dict[str, dict[str, Any]]

A dictionary with overall statistics, and string, numeric, and boolean statistics per column. The long-format value columns are classified by name (value_bool boolean, value_double / value_integer numeric, value_string string), so every signal has the same keys; other columns by dtype. systime, uuid and is_delta are not described per column.

compute ¤

compute(
    output_format: str = "dict",
) -> pd.DataFrame | dict[str, dict[str, dict[str, Any]]]

Compute and return descriptive statistics for each UUID in the DataFrame.

Parameters:

Name Type Description Default
output_format str

The desired output format ('dict' or 'dataframe'). Defaults to 'dict'.

'dict'

Returns:

Type Description
DataFrame | dict[str, dict[str, dict[str, Any]]]

Union[DataFrame, dict]: A DataFrame or a nested dictionary with the UUID as the key and specific statistics related to that UUID's data type. An empty frame gives {} (or an empty DataFrame).

Raises:

Type Description
ValueError

For an unknown output_format.

ColumnNotFoundError

If the frame has no uuid column.