cancel
Showing results for 
Search instead for 
Did you mean: 
suxinji
Employee Alumni
Employee Alumni

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)

Screen Shot 2022-04-05 at 5.26.16 PM.pngScreen Shot 2022-04-05 at 5.24.08 PM.pngScreen Shot 2022-04-05 at 5.24.01 PM.pngScreen Shot 2022-04-05 at 5.23.55 PM.png

 

Best Practices Index
Best Practices

Just here to browse knowledge? This might help!

Contributors
Version history
Last update:
‎04-06-2022 04:35 PM
Updated by: