Skip to content

Commit 3059a2b

Browse files
authored
Merge pull request #4 from CSCD01-team14/bugs/pandas-dev#32572
Pep8 update
2 parents 9f5803a + bc32a09 commit 3059a2b

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

pandas/tests/frame/methods/test_rank.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -332,24 +332,32 @@ def test_pct_max_many_rows(self):
332332

333333
def test_rank_minus_inf_keep_nan(self):
334334
# GH 32593
335-
expected_df = DataFrame({'col': np.array([2.0, 4.0, np.nan, 3.0, 1.0])})
336-
result_df = DataFrame({'col': np.array([1, np.inf, np.nan, 10, -np.inf])}).rank(na_option='keep')
335+
expected_df = DataFrame({"col": np.array([2.0, 4.0, np.nan, 3.0, 1.0])})
336+
result_df = DataFrame({"col": np.array([1, np.inf, np.nan, 10, -np.inf])}).rank(
337+
na_option="keep"
338+
)
337339
tm.assert_frame_equal(expected_df, result_df)
338340

339341
def test_rank_inf_keep_nan(self):
340342
# GH 32593
341-
expected_df = DataFrame({'col': np.array([1.0, 2.0, 3.0])})
342-
result_df = DataFrame({'col': np.array([-np.inf, 0, np.inf])}).rank(na_option='keep')
343+
expected_df = DataFrame({"col": np.array([1.0, 2.0, 3.0])})
344+
result_df = DataFrame({"col": np.array([-np.inf, 0, np.inf])}).rank(
345+
na_option="keep"
346+
)
343347
tm.assert_frame_equal(expected_df, result_df)
344348

345349
def test_rank_inf_bottom_nan(self):
346350
# GH 32593
347-
expected_df = DataFrame({'col': np.array([1.0, 2.0, 4.0, 3.0])})
348-
result_df = DataFrame({'col': np.array([-np.inf, 0, np.nan, np.inf])}).rank(na_option='bottom')
351+
expected_df = DataFrame({"col": np.array([1.0, 2.0, 4.0, 3.0])})
352+
result_df = DataFrame({"col": np.array([-np.inf, 0, np.nan, np.inf])}).rank(
353+
na_option="bottom"
354+
)
349355
tm.assert_frame_equal(expected_df, result_df)
350356

351357
def test_rank_inf_decimal_nan(self):
352358
# GH 32593
353-
expected_df = DataFrame({'col': np.array([2.0,3.0,4.5,6.0,1.0,4.5])})
354-
result_df = DataFrame({'col': np.array([5.5, 6.99, np.inf, np.nan, 0.7, np.inf])}).rank(na_option='bottom')
355-
tm.assert_frame_equal(expected_df, result_df)
359+
expected_df = DataFrame({"col": np.array([2.0, 3.0, 4.5, 6.0, 1.0, 4.5])})
360+
result_df = DataFrame(
361+
{"col": np.array([5.5, 6.99, np.inf, np.nan, 0.7, np.inf])}
362+
).rank(na_option="bottom")
363+
tm.assert_frame_equal(expected_df, result_df)

0 commit comments

Comments
 (0)