Skip to content

Commit 511cc77

Browse files
7th update for issue 3439
1 parent 925e5db commit 511cc77

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pandas/core/reshape/pivot.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ def pivot_table(data, values=None, index=None, columns=None, aggfunc='mean',
5050
5151
Examples
5252
--------
53-
>>> df
53+
>>> 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]})
5461
A B C D
5562
0 foo one small 1
5663
1 foo one large 2
@@ -458,6 +465,7 @@ def crosstab(index, columns, values=None, rownames=None, colnames=None,
458465
>>> bar = pd.Categorical(['d', 'e'], categories=['d', 'e', 'f'])
459466
>>> crosstab(foo, bar) # 'c' and 'f' are not represented in the data,
460467
... # but they still will be counted in the output
468+
... # doctest: +SKIP
461469
col_0 d e f
462470
row_0
463471
a 1 0 0

0 commit comments

Comments
 (0)