QuestionQ56

VerifiedPrepare data and use feature engineering in Snowflake

A Data Scientist is building a Jupyter notebook for model development. The Data Scientist needs to connect to Snowflake with the Python Connector and create a pandas DataFrame from data queried from a table named SALES.

Which code will execute successfully and populate the DataFrame?

Explanation

After executing a SELECT statement, Cursor.fetch_pandas_all() retrieves all rows in the cursor’s result set and loads them into a pandas DataFrame. write_pandas() is for writing an existing pandas DataFrame to Snowflake, not for retrieving query results. The Snowflake Python module is normally imported with import snowflake.connector.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!