QuestionQ152

VerifiedUsing Pandas API on Spark

Given the following code fragment:

Question Image

Which method converts a Pandas API on Spark DataFrame (pyspark.pandas.DataFrame) to a standard PySpark DataFrame (pyspark.sql.DataFrame)?

Explanation

DataFrame.to_spark() converts a pandas API on Spark DataFrame into a PySpark SQL DataFrame. Apache Spark documents this conversion for accessing the full PySpark API; to_pandas() converts to a local pandas DataFrame instead.

Learn more

Community Discussion

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