Skip to content

Commit b26a907

Browse files
committed
modified: pandas/tests/reshape/test_pivot.py
- Removed docstring for `test_pivot_table_index_and_column_keys_with_nan` per comment feedback.
1 parent 5f74843 commit b26a907

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

pandas/tests/reshape/test_pivot.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2530,37 +2530,6 @@ def test_pivot_table_aggfunc_nunique_with_different_values(self):
25302530
tm.assert_frame_equal(result, expected)
25312531

25322532
def test_pivot_table_index_and_column_keys_with_nan(self, dropna: bool) -> None:
2533-
"""Index/column keys containing NA values depend on ``dropna``.
2534-
2535-
Input data
2536-
----------
2537-
row col val
2538-
0 NaN 0.0 0
2539-
1 0.0 1.0 1
2540-
2 1.0 2.0 2
2541-
3 2.0 3.0 3
2542-
4 3.0 NaN 4
2543-
2544-
``dropna=True``: Index/column keys containing NA values will be dropped.
2545-
Expected output
2546-
---------------
2547-
col 1.0 2.0 3.0
2548-
row
2549-
0.0 1.0 NaN NaN
2550-
1.0 NaN 2.0 NaN
2551-
2.0 NaN NaN 3.0
2552-
2553-
``dropna=False``: Index/columns should exist if any non-null values.
2554-
Expected output
2555-
---------------
2556-
col 0.0 1.0 2.0 3.0 NaN
2557-
row
2558-
0.0 NaN 1.0 NaN NaN NaN
2559-
1.0 NaN NaN 2.0 NaN NaN
2560-
2.0 NaN NaN NaN 3.0 NaN
2561-
3.0 NaN NaN NaN NaN 4.0
2562-
NaN 0.0 NaN NaN NaN NaN
2563-
"""
25642533
data = {"row": [None, *range(4)], "col": [*range(4), None], "val": range(5)}
25652534
df = DataFrame(data)
25662535
actual = df.pivot_table(values="val", index="row", columns="col", dropna=dropna)

0 commit comments

Comments
 (0)