Skip to content

Commit 248d8c5

Browse files
committed
Corrections from pre-commit
1 parent 1ed2132 commit 248d8c5

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

pandas/core/reshape/pivot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
from pandas.core.dtypes.cast import maybe_downcast_to_dtype
2222
from pandas.core.dtypes.common import (
23-
is_integer_dtype,
2423
is_list_like,
2524
is_nested_list_like,
2625
is_scalar,

pandas/tests/reshape/test_pivot.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,9 @@ def test_pivot_with_interval_index(self, interval_values, dropna):
300300
# GH 25814
301301
df = DataFrame({"A": interval_values, "B": 1})
302302
result = df.pivot_table(index="A", values="B", dropna=dropna)
303-
expected = DataFrame({"B": 1.0}, index=Index(interval_values.unique(), name="A"))
303+
expected = DataFrame(
304+
{"B": 1.0}, index=Index(interval_values.unique(), name="A")
305+
)
304306
if not dropna:
305307
expected = expected.astype(float)
306308
tm.assert_frame_equal(result, expected)
@@ -1558,7 +1560,9 @@ def test_pivot_datetime_tz(self):
15581560
exp_col1 = Index(["value1", "value1"])
15591561
exp_col2 = Index(["a", "b"], name="label")
15601562
exp_col = MultiIndex.from_arrays([exp_col1, exp_col2])
1561-
expected = DataFrame([[0.0, 3.0], [1.0, 4.0], [2.0, 5.0]], index=exp_idx, columns=exp_col)
1563+
expected = DataFrame(
1564+
[[0.0, 3.0], [1.0, 4.0], [2.0, 5.0]], index=exp_idx, columns=exp_col
1565+
)
15621566
result = pivot_table(df, index=["dt1"], columns=["label"], values=["value1"])
15631567
tm.assert_frame_equal(result, expected)
15641568

@@ -1573,7 +1577,12 @@ def test_pivot_datetime_tz(self):
15731577
expected1 = DataFrame(
15741578
np.array(
15751579
[
1576-
[0, 3, 1, 2,],
1580+
[
1581+
0,
1582+
3,
1583+
1,
1584+
2,
1585+
],
15771586
[1, 4, 2, 1],
15781587
[2, 5, 1, 2],
15791588
],
@@ -1776,7 +1785,7 @@ def test_pivot_table_margins_name_with_aggfunc_list(self):
17761785
expected = DataFrame(table.values, index=ix, columns=cols)
17771786
tm.assert_frame_equal(table, expected)
17781787

1779-
def test_categorical_margins(self, observed, request):
1788+
def test_categorical_margins(self, observed):
17801789
# GH 10989
17811790
df = DataFrame(
17821791
{"x": np.arange(8), "y": np.arange(8) // 4, "z": np.arange(8) % 2}
@@ -1789,7 +1798,7 @@ def test_categorical_margins(self, observed, request):
17891798
table = df.pivot_table("x", "y", "z", dropna=observed, margins=True)
17901799
tm.assert_frame_equal(table, expected)
17911800

1792-
def test_categorical_margins_category(self, observed, request):
1801+
def test_categorical_margins_category(self, observed):
17931802
df = DataFrame(
17941803
{"x": np.arange(8), "y": np.arange(8) // 4, "z": np.arange(8) % 2}
17951804
)

0 commit comments

Comments
 (0)