Skip to main content
PYSPARK • LESSON 07

Display DataFrame Contents

How do we print DataFrame rows in tabular format without truncating long string values?

Beginner2 Minutes145 XP
🤔 THE QUESTION

How do we print DataFrame rows in tabular format without truncating long string values?

💡 WHAT IS IT?

The show() action prints tabular rows to the console, with truncate=False preserving full column values.

🎯 WHAT IS IT USED FOR?

Quick visual inspection of intermediate transformation results during development and pipeline debugging.

💻 EXAMPLE
df.show(5, truncate=False)

🎯 Mission Objectives

Practice typing production-grade PySpark code for Display DataFrame Contents.

  • Execute the show() action
  • Limit output to 5 rows
  • Disable string truncation for full visibility