snowflake.snowpark.DataFrame.with_columns¶
- DataFrame.with_columns(col_names: List[str], values: List[Column | TableFunctionCall]) DataFrame[source]¶
Returns a DataFrame with additional columns with the specified names
col_names. The columns are computed by using the specified expressionsvalues.If columns with the same names already exist in the DataFrame, those columns are removed and appended at the end by new columns.
Example 1:
Example 2:
- Parameters:
col_names – A list of the names of the columns to add or replace.
values – A list of the
Columnobjects ortable_function.TableFunctionCallobject to add or replace.