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 992eaff commit d1c5053Copy full SHA for d1c5053
pandas/tests/groupby/test_groupby_dropna.py
@@ -389,13 +389,22 @@ def test_groupby_nan_included():
389
[
390
pytest.param("group", id="column"),
391
pytest.param(pd.Series(["g1", np.nan, "g1", "g2", np.nan]), id="Series"),
392
+ pytest.param(
393
+ pd.Series(["g1", np.nan, "g1", "g2", np.nan]).astype("category"),
394
+ id="Categorical",
395
+ ),
396
pytest.param("_index", id="index"),
397
+ pytest.param(["group", "group2"], id="multikey"),
398
],
399
)
400
@pytest.mark.parametrize("dropna", [True, False, None])
401
def test_groupby_nan_included_warns(by, dropna):
402
# GH 61339
- data = {"group": ["g1", np.nan, "g1", "g2", np.nan], "B": [0, 1, 2, 3, 4]}
403
+ data = {
404
+ "group": ["g1", np.nan, "g1", "g2", np.nan],
405
+ "group2": ["g1", "g2", np.nan, "g2", np.nan],
406
+ "B": [0, 1, 2, 3, 4],
407
+ }
408
df = pd.DataFrame(data)
409
if isinstance(by, str) and by == "_index":
410
df = df.set_index("group")
0 commit comments