Skip to content

Commit 0aaa347

Browse files
authored
BUG: GH25871 -- fix PEP 8 issues on test source
2nd shot...
1 parent 50e7d64 commit 0aaa347

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/tests/groupby/test_categorical.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -458,18 +458,18 @@ def test_dataframe_categorical_with_nan(observed):
458458
@pytest.mark.parametrize("sort", [True, False])
459459
def test_dataframe_categorical_ordered_observed_sort(ordered, observed, sort):
460460
# GH 25871: Fix groupby sorting on ordered Categoricals
461-
# Build a dataframe with a Categorical having one unobserved category ('AWOL'),
461+
# Build a dataframe with cat having one unobserved category ('AWOL'),
462462
# and a Series with identical values
463-
cat = pd.Categorical(['d', 'a', 'b', 'a', 'd', 'b'],
464-
categories=['a', 'b', 'AWOL', 'd'],
463+
cat = pd.Categorical(['d', 'a', 'b', 'a', 'd', 'b'],
464+
categories=['a', 'b', 'AWOL', 'd'],
465465
ordered=ordered)
466466
val = pd.Series(['d', 'a', 'b', 'a', 'd', 'b'])
467467
df = pd.DataFrame({'cat': cat, 'val': val})
468468

469469
# aggregate on the Categorical
470470
result = (df.groupby('cat', observed=observed, sort=sort)['val']
471471
.aggregate('first'))
472-
472+
473473
# If ordering works, we expect index labels equal to aggregation results,
474474
# except for 'observed=False': index contains 'AWOL' and aggregation None
475475
label = pd.Series(result.index.array, dtype='object')

0 commit comments

Comments
 (0)