
Explanation:
To view the data of a DataFrame in a tabular format within a Databricks notebook, the display() command is used. This command not only allows you to see the data in a table but also provides the option to quickly create various visualizations directly from the data. For example:
%python
display(data)
%python
display(data)
By clicking the down arrow next to the table, you can select from a list of visualization types to represent your data visually. Therefore, the correct answer is display(df).
Ultimate access to all questions.
In a Databricks notebook, which method allows you to view the contents of a Spark DataFrame df in a tabular format and also offers the capability to create various embedded visualizations on the data?
A
view(df)
B
take(df)
C
print(df)
D
show(df)
E
display(df)
No comments yet.