You are viewing documentation about an older version (1.29.0). View latest version

snowflake.snowpark.DataFrame.to_df

DataFrame.to_df(*names: Union[str, Iterable[str]]) DataFrame[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.29.0/snowpark-python/src/snowflake/snowpark/dataframe.py#L1230-L1281)

Creates a new DataFrame containing columns with the specified names.

The number of column names that you pass in must match the number of columns in the existing DataFrame.

Examples:

>>> df1 = session.range(1, 10, 2).to_df("col1")
>>> df2 = session.range(1, 10, 2).to_df(["col1"])
Copy
Parameters:

names – list of new column names

语言: 中文