Skip to content

Commit 7076841

Browse files
committed
fixed linting errors
1 parent 1f76d21 commit 7076841

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

pandas/core/algorithms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"""
55
from __future__ import annotations
66

7-
import operator
87
import functools
8+
import operator
99
from textwrap import dedent
1010
from typing import TYPE_CHECKING, Dict, Optional, Tuple, Union, cast
1111
from warnings import catch_warnings, simplefilter, warn

pandas/tests/indexing/multiindex/test_multiindex.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,24 @@ def test_multiindex_get_loc_list_raises(self):
9595

9696
def test_combine_first_with_nan_index():
9797
mi1 = pd.MultiIndex.from_arrays(
98-
[["b", "b", "c", "a", "b", np.nan], [1, 2, 3, 4, 5, 6]],
99-
names=["a", "b"]
98+
[["b", "b", "c", "a", "b", np.nan], [1, 2, 3, 4, 5, 6]], names=["a", "b"]
10099
)
101100
df = pd.DataFrame({"c": [1, 1, 1, 1, 1, 1]}, index=mi1)
102101
mi2 = pd.MultiIndex.from_arrays(
103102
[["a", "b", "c", "a", "b", "d"], [1, 1, 1, 1, 1, 1]], names=["a", "b"]
104103
)
105104
s = pd.Series([1, 2, 3, 4, 5, 6], index=mi2)
106105
df_combined = df.combine_first(pd.DataFrame({"col": s}))
107-
mi_expected = pd.MultiIndex.from_arrays([
108-
["a", "a", "a", "b", "b", "b", "b", "c", "c", "d", np.nan],
109-
[1, 1, 4, 1, 1, 2, 5, 1, 3, 1, 6]
110-
], names=["a", "b"])
106+
mi_expected = pd.MultiIndex.from_arrays(
107+
[
108+
["a", "a", "a", "b", "b", "b", "b", "c", "c", "d", np.nan],
109+
[1, 1, 4, 1, 1, 2, 5, 1, 3, 1, 6],
110+
],
111+
names=["a", "b"],
112+
)
111113
assert (df_combined.index == mi_expected).all()
112114
exp_col = np.asarray(
113115
[1.0, 4.0, np.nan, 2.0, 5.0, np.nan, np.nan, 3.0, np.nan, 6.0, np.nan]
114116
)
115-
act_col = df_combined['col'].values
117+
act_col = df_combined["col"].values
116118
assert np.allclose(act_col, exp_col, rtol=0, atol=0, equal_nan=True)

0 commit comments

Comments
 (0)