Skip to content

Commit af9f3de

Browse files
committed
transposed blocks to keep axis_int parameter intact
1 parent 98a70df commit af9f3de

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pandas/core/generic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9286,13 +9286,13 @@ def ranker(blk_values):
92869286
)
92879287
else:
92889288
ranks = algos.rank(
9289-
blk_values,
9290-
axis=1 - axis_int,
9289+
blk_values.T,
9290+
axis=axis_int,
92919291
method=method,
92929292
ascending=ascending,
92939293
na_option=na_option,
92949294
pct=pct,
9295-
)
9295+
).T
92969296
return ranks
92979297

92989298
if numeric_only:

pandas/tests/frame/methods/test_rank.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,6 @@ def test_rank_inf_and_nan(self, contents, dtype, frame_or_series):
405405
# Shuffle the testing array and expected results in the same way
406406
random_order = np.random.default_rng(2).permutation(len(values))
407407
obj = frame_or_series(values[random_order])
408-
print("TYPE", type(obj))
409408
expected = frame_or_series(exp_order[random_order], dtype="float64")
410409
result = obj.rank()
411410
tm.assert_equal(result, expected)

0 commit comments

Comments
 (0)