Question: I am using a Polar data frame for the first time. I am trying to match input values with data in the Postgres table. Sharing some sample code which is part of the actual code. I have a column called "Score" of type list[i32]. As a next step, I am trying to find the maximum value in that list. I am getting errors. import polars as pl import jaro def test_polars(): fname='sarah' lname = 'vatssss' data = {"first_name": ['sarah', 'purnima'], "last_name": ['vats', 'malik']} df = pl.DataFrame(data) print(df) df = (df.with_columns( [ (pl.when(pl.col("first_name") == fname).then(1).otherwise(0)).alias("E_FN"), (pl.when(pl.col("last_name") == lname).then(1).otherwise(0)).alias("E_LN"), (pl.when(pl.col("first_name").str.slice(0, 3) == fname[0:3]).then(1).otherwise(0)).alias("F3_FN"), (pl.when(pl.col("first_name").map_elements( lambda first_name: jaro.jaro_winkler_metric(first_name, fname)) >= 0.8).then(1).otherwise(0)).alias( "CMP80_FN"), (pl.when(pl.col("last_name").map_elements( lambda first_name: jaro.jaro_winkler_metric(first_name, lname)) >= 0.9).then(1).otherwise(0)).alias( "CMP90_LN"), ] ) .with_columns( [ pl.concat_list(980 * pl.col("E_FN") , 970 * pl.col("E_LN") ).alias("score") ] ) .with_columns( [pl.max(pl.col("score")).alias("max_score") ] ) ) print(df) if __name__ == '__main__': test_polars() C:\PythonProject\pythonProject\venv\Graph_POC\Scripts\python.exe "C:\PythonProject\pythonProject\polars data.py" shape: (2, 2) ┌────────────┬───────────┐ │ first_name ┆ last_name │ │ --- ┆ --- │ │ str ┆ str │ ╞════════════╪═══════════╡ │ sarah ┆ vats │ │ purnima ┆ malik │ └────────────┴───────────┘ Traceback (most recent call last): File "C:\PythonProject\pythonProject\polars data.py", line 45, in <module> test_polars() File "C:\PythonProject\pythonProject\polars data.py", line 34, in test_polars [pl.max(pl.col("score")).alias("max_score") ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PythonProject\pythonProject\venv\Graph_POC\Lib\site-packages\polars\functions\aggregation\vertical.py", line 175, in max return F.col(*names).max() ^^^^^^^^^^^^^ File "C:\PythonProject\pythonProject\venv\Graph_POC\Lib\site-packages\polars\functions\col.py", line 288, in __new__ return _create_col(name, *more_names) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PythonProject\pythonProject\venv\Graph_POC\Lib\site-packages\polars\functions\col.py", line 67, in _create_col raise TypeError(msg) TypeError: invalid input for `col` Expected `str` or `DataType`, got 'Expr'. Process finished with exit code 1 

Answer: you can use list.max() function. Simple example: df = pl.DataFrame( { "a": [[1, 8, 3],[6,2,7],[8,10,11]], "b": [4, 5, None], } ) ┌─────────────┬──────┐ │ a ┆ b │ │ --- ┆ --- │ │ list[i64] ┆ i64 │ ╞═════════════╪══════╡ │ [1, 8, 3] ┆ 4 │ │ [6, 2, 7] ┆ 5 │ │ [8, 10, 11] ┆ null │ └─────────────┴──────┘ df.with_columns( pl.col('a').list.max().alias('max_a') ) ┌─────────────┬──────┬───────┐ │ a ┆ b ┆ max_a │ │ --- ┆ --- ┆ --- │ │ list[i64] ┆ i64 ┆ i64 │ ╞═════════════╪══════╪═══════╡ │ [1, 8, 3] ┆ 4 ┆ 8 │ │ [6, 2, 7] ┆ 5 ┆ 7 │ │ [8, 10, 11] ┆ null ┆ 11 │ └─────────────┴──────┴───────┘  so in your case just use pl.col("score").list.max instead of pl.max(pl.col("score")). max() is just a syntactic sugar for col(names).max() and supposed to return max value of the column, not max value of the list type cell of the column.