Skip to content

Series Summaries Options

Base configuration options shared for Series summary.

Subclasses may extend this dataclass with additional parameters.

Parameters:

Name Type Description Default
value_counts bool or None
  • None: auto split numeric/non-numeric
  • True: frequency summary only
  • False: descriptive statistics only
None
d_func dict

Custom metric functions grouped by metric type.

D_FUNC
skip_na bool or None

Skip NA statistics.

False
round_perc int

Percentage rounding decimals.

1
round_perc int

Percentage rounding decimals.

1
round_desc int

Descriptive rounding decimals.

2
_tot_shape int

External total used for percentage calculations.

None
label_type str

Name of MultiIndex level containing summary type information

'dtype'
label_type_all str

Name of MultiIndex type value for numeric+non-numeric metric

'all'
label_type_not_num str

Name of MultiIndex type value for numeric metric

'Not Numeric'
label_type_num str

Name of MultiIndex type value for non-numeric metric

'Numeric'
label_mode str

Name of MultiIndex level containing summary mode information

'Mode'
label_mode_desc str

Name of MultiIndex mode value for pandas describe metric

'Describe'
label_mode_value_count str

Name of MultiIndex mode value for pandas value_count metric

'Value Count'
label_mode_custom str

Name of MultiIndex mode value for pandas custom (d_func) metric

'Custom'
label_metric str

Name of MultiIndex level containing summary metric information

'Metric'
label_metric_count str

Name of MultiIndex metric value for count metric

'Num. elements'
label_metric_nas str

Name of MultiIndex metric value for NAs metric

'NAs'
label_metric_type str

Name of MultiIndex level containing summary type of metric information

'Type'
label_metric_type_count str

Name of MultiIndex type of metric value for count metric

'count'
label_metric_type_percentile str

Name of MultiIndex type of metric value for percentile metric

'percentile'
label_metric_type_perc str

Name of MultiIndex type of metric value for percentage metric

'%'
describe_kwargs Dict

Any keyword argument accepted by pandas describe

dict()
Source code in metaframe/src/utils/opts_dataclass/summary.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
@dataclass(frozen=True, kw_only=True, slots=True)
class SeriesSummaryOpts:
    """
    Base configuration options shared for Series `summary`.

    Subclasses may extend this dataclass with additional parameters.

    Parameters
    ----------
    value_counts : bool or None, default None
        * None: auto split numeric/non-numeric
        * True: frequency summary only
        * False: descriptive statistics only
    d_func : dict, default D_FUNC
        Custom metric functions grouped by metric type.
    skip_na : bool or None, default False
        Skip NA statistics.
    round_perc : int, default 1
        Percentage rounding decimals.
    round_perc : int, default 1
        Percentage rounding decimals.
    round_desc : int, default 2
        Descriptive rounding decimals.
    _tot_shape : int, optional
        External total used for percentage calculations.
    label_type: str = "dtype""
        Name of MultiIndex level containing summary type information
    label_type_all: str = "all"
        Name of MultiIndex type value for numeric+non-numeric metric
    label_type_not_num: str = "Not numeric"
        Name of MultiIndex type value for numeric metric
    label_type_num: str = "Numeric"
        Name of MultiIndex type value for non-numeric metric
    label_mode: str = "Mode"
        Name of MultiIndex level containing summary mode information
    label_mode_desc: str = "Describe"
        Name of MultiIndex mode value for pandas ``describe`` metric
    label_mode_value_count: str = "Value Count"
        Name of MultiIndex mode value for pandas ``value_count`` metric
    label_mode_custom: str = "Custom"
        Name of MultiIndex mode value for pandas custom (d_func) metric
    label_metric: str = "Metric"
        Name of MultiIndex level containing summary metric information
    label_metric_count: str = "Num. elements"
        Name of MultiIndex metric value for count metric
    label_metric_nas: str = "NAs"
        Name of MultiIndex metric value for NAs metric
    label_metric_type: str = "Type"
        Name of MultiIndex level containing summary type of metric information
    label_metric_type_count: str = "Count"
        Name of MultiIndex type of metric value for count metric
    label_metric_type_percentile: str = "percentile"
        Name of MultiIndex type of metric value for percentile metric
    label_metric_type_perc: str = "%"
        Name of MultiIndex type of metric value for percentage metric
    describe_kwargs: Dict = field(default_factory={})
        Any keyword argument accepted by pandas `describe`
    """
    ## Series.summary() opts
    value_counts: bool | None = None
    d_func: Dict = field(default_factory=default_d_func)
    skip_na: bool | None = False
    round_perc: int = 1
    round_desc: int = 2
    _tot_shape: int | None = None 
    ### Labels
    label_type: str = "dtype"
    label_type_all: str = "all"
    label_type_not_num: str = "Not Numeric"
    label_type_num: str = "Numeric"
    label_mode: str = "Mode"
    label_mode_desc: str = "Describe"
    label_mode_value_count: str = "Value Count"
    label_mode_custom: str = "Custom"
    label_metric: str = "Metric"
    label_metric_count: str = "Num. elements"
    label_metric_nas: str = "NAs"
    label_metric_type: str = "Type"
    label_metric_type_count: str = "count"
    label_metric_type_percentile: str = "percentile"
    label_metric_type_perc: str = "%"
    ## Other kwargs from pandas describe are possible
    describe_kwargs: Dict = field(default_factory=dict)