Being a new user to polars coming from pandas, I have searched polars GitHub pages, user guide, stackoverflow and discord channel on how to add a new column to a polars dataframe. I have only found polars examples on how to add new columns based on existing ones.
How should the following pandas example be converted to polars syntax?
import polars as pl
df = pl.DataFrame({'existing_column': [1, 2, 3]})
df_pd = df.to_pandas()
df_pd['new_column'] = 'some text'
With expected content of final dataframe:
| existing_column | new_column |
|---|---|
| 1 | some_text |
| 2 | some_text |
| 3 | some_text |