QuestionQ94

VerifiedData Processing

A data scientist receives an incomplete notebook from the data engineering team. The notebook uses a Spark DataFrame, spark_df, on which the data scientist must perform additional feature engineering. Unfortunately, the data scientist has not yet learned the PySpark DataFrame API.

Which of the following code blocks can the data scientist run to use the pandas API on Spark?

Explanation

The pandas API on Spark is accessed through pyspark.pandas. Creating ps.DataFrame(spark_df) from an existing Spark DataFrame produces a pandas-on-Spark DataFrame, enabling pandas-style operations while using Spark execution.

Community Discussion

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