Exit DATABRICKS-MACHINE-LEARNING-ASSOCIATE Databricks Certified Machine Learning Associate
Question 3 of 5
0% complete
Q3 Single choice

A data scientist has been given an incomplete notebook from the data engineering team. The notebook uses a Spark DataFrame spark_df on which the data scientist needs to perform further feature engineering. Unfortunately, the data scientist has not yet learned the PySpark DataFrame API.

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

  • A

    import pyspark.pandas as ps
    df = ps.DataFrame(spark_df)

  • B

    import pyspark.pandas as ps
    df = ps.to_pandas(spark_df)

  • C

    spark_df.to_pandas()

  • D

    import pandas as pd
    df = pd.DataFrame(spark_df)