how to format a int column into HH:MM:SS.0 in polars
09:55 10 Mar 2026

I have a column of numbers, and I want to add a column that changes this to HH:MM:SS

df = pl.DataFrame({"seconds": [1.0, 4562.2, 2.44,123.567]})

I have tried

df.with_columns(hhmmss=pl.struct('seconds').map_elements(lambda x: str(timedelta(seconds = str(x)))))

to no avail

Is there another way to do this?

polars