ts_shape.features.stats.feature_table
¤
Classes:
-
DescriptiveFeatures
–A class used to compute descriptive statistics for a DataFrame, grouped by UUID.
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.
dataframe : pandas.DataFrame DataFrame containing the data
Methods:
-
compute
–Compute and return descriptive statistics for each UUID in the DataFrame.
-
compute_per_group
–Compute and return statistics for each column in the DataFrame group.
-
overall_stats
–Compute and return overall statistics for the DataFrame group.
Source code in src/ts_shape/features/stats/feature_table.py
24 25 26 27 28 29 30 31 |
|
compute
¤
compute(output_format: str = 'dict') -> Union[DataFrame, Dict[str, Dict[str, Dict[str, Union[int, float, str, bool]]]]]
Compute and return descriptive statistics for each UUID in the DataFrame.
Parameters:
-
output_format
¤str
, default:'dict'
) –The desired output format ('dict' or 'dataframe'). Defaults to 'dict'.
Returns:
-
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.
Source code in src/ts_shape/features/stats/feature_table.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
compute_per_group
¤
Compute and return statistics for each column in the DataFrame group.
Returns:
-
dict
(Dict[str, Dict[str, Union[int, float, str, bool]]]
) –A dictionary with overall statistics, and string, numeric, and boolean statistics per column.
Source code in src/ts_shape/features/stats/feature_table.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
overall_stats
¤
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:
Source code in src/ts_shape/features/stats/feature_table.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|