snowflake.snowpark.DataFrame.withColumn¶
- DataFrame.withColumn(col_name: str, col: Column | TableFunctionCall) DataFrame[source]¶
Returns a DataFrame with an additional column with the specified name
col_name. The column is computed by using the specified expressioncol.If a column with the same name already exists in the DataFrame, that column is replaced by the new column.
Example 1:
Example 2:
- Parameters:
col_name – The name of the column to add or replace.
col – The
Columnortable_function.TableFunctionCallwith single column output to add or replace.