Skip to content

Commit fda8be0

Browse files
committed
formatting with black pandas
1 parent 4f3bcbc commit fda8be0

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

pandas/core/generic.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -6895,12 +6895,17 @@ def interpolate(
68956895
"column to a numeric dtype."
68966896
)
68976897

6898-
6899-
if method in ['backfill', 'bfill', 'pad', 'ffill']:
6900-
return self.fillna(method=method, axis=axis, inplace=inplace, limit=limit, downcast=downcast)
6898+
if method in ["backfill", "bfill", "pad", "ffill"]:
6899+
return self.fillna(
6900+
method=method,
6901+
axis=axis,
6902+
inplace=inplace,
6903+
limit=limit,
6904+
downcast=downcast,
6905+
)
69016906
# create/use the index
69026907

6903-
if axis==0:
6908+
if axis == 0:
69046909
df = self
69056910
else:
69066911
df = self.T

pandas/tests/frame/methods/test_interpolate.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def test_interp_leading_nans(self, check_scipy):
202202
result = df.interpolate(method="polynomial", order=1)
203203
tm.assert_frame_equal(result, expected)
204204

205-
@pytest.mark.parametrize('axis', [0, 1])
205+
@pytest.mark.parametrize("axis", [0, 1])
206206
def test_interp_raise_on_only_mixed(self, axis):
207207
df = DataFrame(
208208
{
@@ -214,7 +214,7 @@ def test_interp_raise_on_only_mixed(self, axis):
214214
}
215215
)
216216
with pytest.raises(TypeError):
217-
df.astype('object').interpolate(axis=axis)
217+
df.astype("object").interpolate(axis=axis)
218218

219219
def test_interp_raise_on_all_object_dtype(self):
220220
# GH 22985
@@ -286,7 +286,6 @@ def test_interp_time_inplace_axis(self, axis):
286286
expected.interpolate(axis=0, method="time", inplace=True)
287287
tm.assert_frame_equal(result, expected)
288288

289-
290289
@pytest.mark.parametrize("axis", [0, 1])
291290
def test_interp_ffill(self, axis):
292291
# GH 33956
@@ -325,6 +324,6 @@ def test_interp_pad(self, axis):
325324
"C": [3.0, 6.0, 9.0, np.nan, np.nan, 30.0],
326325
}
327326
)
328-
expected = df.fillna(method='pad', axis=axis)
327+
expected = df.fillna(method="pad", axis=axis)
329328
result = df.interpolate(method="pad", axis=axis)
330329
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)