We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 925e5db commit 511cc77Copy full SHA for 511cc77
pandas/core/reshape/pivot.py
@@ -50,7 +50,14 @@ def pivot_table(data, values=None, index=None, columns=None, aggfunc='mean',
50
51
Examples
52
--------
53
- >>> df
+ >>> df = pd.DataFrame({"A": ["foo", "foo", "foo", "foo", "foo",
54
+ ... "bar", "bar", "bar", "bar"],
55
+ ... "B": ["one", "one", "one", "two", "two",
56
+ ... "one", "one", "two", "two"],
57
+ ... "C": ["small", "large", "large", "small",
58
+ ... "small", "large", "small", "small",
59
+ ... "large"],
60
+ ... "D": [1, 2, 2, 3, 3, 4, 5, 6, 7]})
61
A B C D
62
0 foo one small 1
63
1 foo one large 2
@@ -458,6 +465,7 @@ def crosstab(index, columns, values=None, rownames=None, colnames=None,
458
465
>>> bar = pd.Categorical(['d', 'e'], categories=['d', 'e', 'f'])
459
466
>>> crosstab(foo, bar) # 'c' and 'f' are not represented in the data,
460
467
... # but they still will be counted in the output
468
+ ... # doctest: +SKIP
461
469
col_0 d e f
462
470
row_0
463
471
a 1 0 0
0 commit comments