Skip to content

feature_table

feature_table ¤

DescriptiveFeatures ¤

DescriptiveFeatures(dataframe: DataFrame)

A class used to compute descriptive statistics for a DataFrame, grouped by UUID.

Attributes¤

data : pandas.DataFrame DataFrame containing the data

Methods¤

compute(): Compute and return descriptive statistics for each UUID in the DataFrame.

Parameters¤

dataframe : pandas.DataFrame DataFrame containing the data

overall_stats ¤

overall_stats(
    group: DataFrame,
) -> Dict[str, Union[int, float]]

Compute and return overall statistics for the DataFrame group.

  • 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.

Returns:

Name Type Description
dict Dict[str, Union[int, float]]

A dictionary with overall statistics.

compute_per_group ¤

compute_per_group(
    group: DataFrame,
) -> Dict[str, Dict[str, Union[int, float, str, bool]]]

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

Returns:

Name Type Description
dict Dict[str, Dict[str, Union[int, float, str, bool]]]

A dictionary with overall statistics, and string, numeric, and boolean statistics per column.

compute ¤

compute(
    output_format: str = "dict",
) -> Union[
    pd.DataFrame,
    Dict[
        str,
        Dict[str, Dict[str, Union[int, float, str, bool]]],
    ],
]

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
Union[DataFrame, Dict[str, Dict[str, Dict[str, Union[int, float, str, bool]]]]]

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.