Skip to main content
AI & ML Code Completion Medium +20 XP

DataFrame Shape

Complete to get the number of rows and columns.

AI & MLFill in the blank
print(df.___)

Type the missing code

Show answer and explanation

Answer: shape

df.shape returns a tuple (rows, columns). It's the first thing to check when exploring a new dataset.

Hint: Which attribute gives dimensions of a DataFrame?

What this challenge tests

Code Completion in AI & ML: pandas, eda.

Related challenges