ts_shape.features.stats.boolean_stats
¤
Classes:
-
BooleanStatistics
–Provides class methods to calculate statistics on a boolean column in a pandas DataFrame.
BooleanStatistics
¤
BooleanStatistics(dataframe: DataFrame, column_name: str = 'systime')
Bases: Base
Provides class methods to calculate statistics on a boolean column in a pandas DataFrame.
Parameters:
-
dataframe
¤DataFrame
) –The DataFrame to be processed.
-
column_name
¤str
, default:'systime'
) –The column to sort by. Default is 'systime'. If the column is not found or is not a time column, the class will attempt to detect other time columns.
Methods:
-
count_false
–Returns the count of False values in the boolean column.
-
count_not_null
–Returns the count of non-null (True or False) values in the boolean column.
-
count_null
–Returns the count of null (NaN) values in the boolean column.
-
count_true
–Returns the count of True values in the boolean column.
-
false_percentage
–Returns the percentage of False values in the boolean column.
-
get_dataframe
–Returns the processed DataFrame.
-
is_balanced
–Indicates if the distribution is balanced (50% True and False) in the specified boolean column.
-
mode
–Returns the mode (most common value) of the specified boolean column.
-
summary_as_dataframe
–Returns a summary of boolean statistics for the specified column as a DataFrame.
-
summary_as_dict
–Returns a summary of boolean statistics for the specified column as a dictionary.
-
true_percentage
–Returns the percentage of True values in the boolean column.
Source code in src/ts_shape/utils/base.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
count_false
classmethod
¤
Returns the count of False values in the boolean column.
Source code in src/ts_shape/features/stats/boolean_stats.py
15 16 17 18 |
|
count_not_null
classmethod
¤
Returns the count of non-null (True or False) values in the boolean column.
Source code in src/ts_shape/features/stats/boolean_stats.py
25 26 27 28 |
|
count_null
classmethod
¤
Returns the count of null (NaN) values in the boolean column.
Source code in src/ts_shape/features/stats/boolean_stats.py
20 21 22 23 |
|
count_true
classmethod
¤
Returns the count of True values in the boolean column.
Source code in src/ts_shape/features/stats/boolean_stats.py
10 11 12 13 |
|
false_percentage
classmethod
¤
Returns the percentage of False values in the boolean column.
Source code in src/ts_shape/features/stats/boolean_stats.py
37 38 39 40 41 42 |
|
get_dataframe
¤
get_dataframe() -> DataFrame
Returns the processed DataFrame.
Source code in src/ts_shape/utils/base.py
34 35 36 |
|
is_balanced
classmethod
¤
Indicates if the distribution is balanced (50% True and False) in the specified boolean column.
Source code in src/ts_shape/features/stats/boolean_stats.py
49 50 51 52 53 |
|
mode
classmethod
¤
Returns the mode (most common value) of the specified boolean column.
Source code in src/ts_shape/features/stats/boolean_stats.py
44 45 46 47 |
|
summary_as_dataframe
classmethod
¤
summary_as_dataframe(dataframe: DataFrame, column_name: str) -> DataFrame
Returns a summary of boolean statistics for the specified column as a DataFrame.
Source code in src/ts_shape/features/stats/boolean_stats.py
67 68 69 70 71 |
|
summary_as_dict
classmethod
¤
Returns a summary of boolean statistics for the specified column as a dictionary.
Source code in src/ts_shape/features/stats/boolean_stats.py
55 56 57 58 59 60 61 62 63 64 65 |
|
true_percentage
classmethod
¤
Returns the percentage of True values in the boolean column.
Source code in src/ts_shape/features/stats/boolean_stats.py
30 31 32 33 34 35 |
|