O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying the contents of a Spark dataframe

There are several ways of displaying subsets of your Spark dataframe. Some of the choices are as follows:

  • showDF: This is a Spark command that displays the contents of a dataframe in a condensed manner.
  • head: This is the normal R function that can be used on a Spark dataframe; it follows the same syntax as base R.
  • take: This command also prints some rows, but collects the rows from the underlying RDD.
  • display: This is a special databricks command that is roughly equivalent to the base R View command, but also allows you to plot a subset of the output via control icons below the horizontal scroll bar below the data. Using display also allows you to switch to graphing mode.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required