@@ -17,6 +17,9 @@ def summarize(
17
17
by : Any = None ,
18
18
) -> pd .DataFrame :
19
19
"""
20
+
21
+ !!! info "New in version 0.25.0"
22
+
20
23
Reduction operation on columns via a tuple.
21
24
22
25
It is a wrapper around `pd.DataFrame.agg`,
@@ -52,14 +55,15 @@ def summarize(
52
55
>>> import pandas as pd
53
56
>>> import numpy as np
54
57
>>> import janitor as jn
55
- >>> pd.set_option("display.max_columns", None)
56
- >>> pd.set_option("display.expand_frame_repr", False)
57
- >>> pd.set_option("max_colwidth", None)
58
58
>>> data = {'avg_jump': [3, 4, 1, 2, 3, 4],
59
59
... 'avg_run': [3, 4, 1, 3, 2, 4],
60
60
... 'avg_swim': [2, 1, 2, 2, 3, 4],
61
- ... 'combine_id': [100200, 100200, 101200, 101200, 102201, 103202],
62
- ... 'category': ['heats', 'heats', 'finals', 'finals', 'heats', 'finals']}
61
+ ... 'combine_id': [100200, 100200,
62
+ ... 101200, 101200,
63
+ ... 102201, 103202],
64
+ ... 'category': ['heats', 'heats',
65
+ ... 'finals', 'finals',
66
+ ... 'heats', 'finals']}
63
67
>>> df = pd.DataFrame(data)
64
68
>>> df.summarize(("avg_run", "mean"), by=['combine_id', 'category'])
65
69
avg_run
0 commit comments