How to convert pandas dataframe back to snowpark dataframe?
pandas_df = snowpark_df.to_pandas()
...
???
How to convert pandas dataframe back to snowpark dataframe?
pandas_df = snowpark_df.to_pandas()
...
???
Try this:
session.create_dataframe(pandas_df)
or alternatively this:
session.write_pandas(pandas_df, ...)
I am late but here you go:
import pandas as pd
from snowflake.snowpark import Session, Table
session: Session = ...
table_name = "table"
column_name = "column"
pandas_df = pd.DataFrame({"table_name": [table_name], "column_name": [column_name]})
snowpark_df = session.create_dataframe(data=pandas_df)
© 2022 - 2025 — McMap. All rights reserved.
write_pandas()
to write the data in the dataframe back to a Snowflake table, and then you can set that table to be a snowpark dataframe. – Stagnerwrite_pandas
. Proof: github.com/snowflakedb/snowpark-python/blob/… – Formalin