I want to concatenate the last letter from two existing columns and create a new column from this using polars.LazyFrame
for example in pandas can achieve this with the following code
import pandas as pd
df = pd.DataFrame({"col1":["abc","def"], "col2":["ghi","jkl"]})
df["last_letters_concat"]=df["col1"].str.strip().str[-1]+df["col2"].str.strip().str[-1]
print(df)
My attempt in polars
import polars as pl
from polars import col
#using same df
df.lazy().with_column(
(pl.col("col1")[-1] + pl.col('col2'))[-1].alias("last_letters_concat")).collect()
How can i do this?