numeric_stats
numeric_stats ¤
NumericStatistics ¤
NumericStatistics(
dataframe: DataFrame, time_column: str = "systime"
)
Bases: Base
Provides class methods to calculate statistics on numeric columns in a pandas DataFrame.
column_mean
classmethod
¤
column_mean(
dataframe: DataFrame, value_column: str
) -> float
Calculate the mean of a specified column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The mean of the non-missing values; NaN when there is none. |
column_median
classmethod
¤
column_median(
dataframe: DataFrame, value_column: str
) -> float
Calculate the median of a specified column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The median of the non-missing values; NaN when there is none. |
column_std
classmethod
¤
column_std(
dataframe: DataFrame, value_column: str
) -> float
Calculate the standard deviation of a specified column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The sample standard deviation ( |
column_variance
classmethod
¤
column_variance(
dataframe: DataFrame, value_column: str
) -> float
Calculate the variance of a specified column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The sample variance ( |
column_min
classmethod
¤
column_min(
dataframe: DataFrame, value_column: str
) -> float
Calculate the minimum value of a specified column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The smallest value; NaN when there is none. |
column_max
classmethod
¤
column_max(
dataframe: DataFrame, value_column: str
) -> float
Calculate the maximum value of a specified column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The largest value; NaN when there is none. |
column_sum
classmethod
¤
column_sum(
dataframe: DataFrame, value_column: str
) -> float
Calculate the sum of a specified column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The sum of the values; 0 when there is none. |
column_kurtosis
classmethod
¤
column_kurtosis(
dataframe: DataFrame, value_column: str
) -> float
Calculate the kurtosis of a specified column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The bias-corrected excess kurtosis; NaN for fewer than 4 values. |
column_skewness
classmethod
¤
column_skewness(
dataframe: DataFrame, value_column: str
) -> float
Calculate the skewness of a specified column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The bias-corrected skewness; NaN for fewer than 3 values. |
column_quantile
classmethod
¤
column_quantile(
dataframe: DataFrame, value_column: str, quantile: float
) -> float
Calculate a specific quantile of the column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
quantile
|
float
|
Quantile to compute, between 0 and 1 (0.5 is the median). |
required |
Returns:
| Type | Description |
|---|---|
float
|
The quantile (linear interpolation); NaN when there is no value. |
column_iqr
classmethod
¤
column_iqr(
dataframe: DataFrame, value_column: str
) -> float
Calculate the interquartile range of the column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Third minus first quartile of the non-missing values; NaN when there is none. |
column_range
classmethod
¤
column_range(
dataframe: DataFrame, value_column: str
) -> float
Calculate the range of the column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Largest minus smallest value; NaN when there is none. |
column_mad
classmethod
¤
column_mad(
dataframe: DataFrame, value_column: str
) -> float
Calculate the mean absolute deviation of the column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The mean absolute deviation from the mean; NaN when there is no value. |
column_mode
classmethod
¤
column_mode(
dataframe: DataFrame, value_column: str
) -> float | None
Calculate the mode of a specified column. Returns None if column is empty.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float | None
|
The most frequent value (the smallest on a tie), or |
coefficient_of_variation
classmethod
¤
coefficient_of_variation(
dataframe: DataFrame, value_column: str
) -> float
Calculate the coefficient of variation of the column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Standard deviation divided by the mean, or |
float
|
mean is 0 (the ratio is undefined). |
standard_error_mean
classmethod
¤
standard_error_mean(
dataframe: DataFrame, value_column: str
) -> float
Calculate the standard error of the mean for the column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The standard error of the mean; NaN for fewer than 2 values. |
describe
classmethod
¤
describe(dataframe: DataFrame) -> pd.DataFrame
Provide a statistical summary for numeric columns in the DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame; every numeric column is described. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
The output of |
summary_as_dict
classmethod
¤
summary_as_dict(
dataframe: DataFrame, value_column: str
) -> dict[str, float | int | None]
Returns a dictionary with comprehensive numeric statistics for the specified column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, float | int | None]
|
Dict with keys |
summary_as_dataframe
classmethod
¤
summary_as_dataframe(
dataframe: DataFrame, value_column: str
) -> pd.DataFrame
Returns a DataFrame with comprehensive numeric statistics for the specified column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame. |
required |
value_column
|
str
|
Name of the numeric column to analyze. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
One-row DataFrame with the keys of |