Suppose we have this dataframe in polars (python): import polars as pl df = pl.DataFrame( { "era": ["01", "01", "02", "02", "03", "03"], "pred": [3,5,6,8,9,1] } ) I can create a rank/row_number based on one column, like: df.with_columns(rn = pl.col("era").rank("ordinal")) But if I want to do it based on two columns, it is not working: df.with_columns(rn = pl.col(["era","pred"]).rank("ordinal")) I get this error message: ComputeError: The name: 'rn' passed to `LazyFrame.with_columns` is duplicate Error originated just after this operation: DF ["era", "pred"]; PROJECT */2 COLUMNS; SELECTION: "None" Any suggestions on how to do this? Continue reading...