Skip to content

Commit

Permalink
Merge pull request #28 from e10e3/fix-pandas-warnings
Browse files Browse the repository at this point in the history
Fix Pandas' deprecation warnings
  • Loading branch information
sherbold authored Jun 28, 2024
2 parents 971d3dd + de2a372 commit e01f410
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions autorank/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def get_sorted_rank_groups(result, reverse):
for i in range(len(sorted_ranks)):
max_j = None
for j in range(i + 1, len(sorted_ranks)):
if abs(sorted_ranks[i] - sorted_ranks[j]) <= critical_difference:
if abs(sorted_ranks.iloc[i] - sorted_ranks.iloc[j]) <= critical_difference:
max_j = j
# print(i, j)
if max_j is not None and max_j > cur_max_j:
Expand Down Expand Up @@ -512,16 +512,16 @@ def rankpos(rank):

for i in range(math.ceil(len(sorted_ranks) / 2)):
chei = cline + minnotsignificant + i * 0.2
plot_line([(rankpos(sorted_ranks[i]), cline),
(rankpos(sorted_ranks[i]), chei),
plot_line([(rankpos(sorted_ranks.iloc[i]), cline),
(rankpos(sorted_ranks.iloc[i]), chei),
(textspace - 0.1, chei)],
linewidth=0.7)
plot_text(textspace - 0.2, chei, names[i], ha="right", va="center")

for i in range(math.ceil(len(sorted_ranks) / 2), len(sorted_ranks)):
chei = cline + minnotsignificant + (len(sorted_ranks) - i - 1) * 0.2
plot_line([(rankpos(sorted_ranks[i]), cline),
(rankpos(sorted_ranks[i]), chei),
plot_line([(rankpos(sorted_ranks.iloc[i]), cline),
(rankpos(sorted_ranks.iloc[i]), chei),
(textspace + scalewidth + 0.1, chei)],
linewidth=0.7)
plot_text(textspace + scalewidth + 0.2, chei, names[i],
Expand All @@ -548,8 +548,8 @@ def rankpos(rank):
no_sig_height = 0.1
start = cline + 0.2
for l, r in groups:
plot_line([(rankpos(sorted_ranks[l]) - side, start),
(rankpos(sorted_ranks[r]) + side, start)],
plot_line([(rankpos(sorted_ranks.iloc[l]) - side, start),
(rankpos(sorted_ranks.iloc[r]) + side, start)],
linewidth=2.5)
start += no_sig_height

Expand Down

0 comments on commit e01f410

Please sign in to comment.