mirror of
https://github.com/tgorordo/carousel.git
synced 2026-06-12 20:42:13 -07:00
rename some vars
This commit is contained in:
parent
9d82d0524a
commit
fd4ffe9da8
1 changed files with 5 additions and 1 deletions
|
|
@ -10,7 +10,11 @@ def rank_to_pref(ranking):
|
|||
"""Converts a ranking to a preference."""
|
||||
id_col_name = ranking.select(pls.by_index(0)).to_series().name
|
||||
preferences = ranking.select(
|
||||
[pl.col(id_col_name).sort_by(c).alias(c) for c in ranking.columns if c != id_col_name]
|
||||
[
|
||||
pl.col(id_col_name).sort_by(c).alias(c)
|
||||
for c in ranking.columns
|
||||
if c != id_col_name
|
||||
]
|
||||
)
|
||||
return preferences
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue