suxinji
-modified.png?version=preview)
Employee Alumni
Options
- Article History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on
04-06-2022
04:35 PM
- edited on
04-06-2022
04:35 PM
by
Tristan
Overview
You can enter a DataFrame name, such as df, to get basic information about the Spark DataFrame.
- Use str() to show the Spark DataFrame structure
- Use display() Incorta Notebook extension to display data.
- Use display(summary()) to print a summary table
- Use colnames() or names() to show all columns from a DataFrame
Solution
# get basic information about the SparkDataFrame.
df
# show the Spark data frame structure
str(df)
# use display() - Incorta Notebook extension to display data
display(df)
# use display(summary(df)) to print summary table
display(summary(df))
# show all columns from data frame
colnames(df)
# show all columns from data frame method 2
names(df)
Labels: