QuestionQ85

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

The code block below must create a single-column DataFrame from the Python list years, which consists of integers. Choose the response that correctly fills the numbered blanks in the code block to complete this task.

_1_._2_(_3_, _4_)  
Explanation

SparkSession.createDataFrame creates a DataFrame from a Python list. Passing the list of integer values directly with an IntegerType() schema creates a one-column DataFrame; a non-StructType schema is wrapped as the sole field. The schema is a data-type instance, so IntegerType() requires parentheses. The PySpark type name is IntegerType (the displayed choice appears to miss the second e).

Learn more

Community Discussion

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