BuildlyBuildly
DashboardExercisesProfileHelp
Data Science/Module 2: Data Analytics/Series & DataFrame3/3
Exercise·7 min·10 XP

Shape and Column Names

Context. Quick sanity check on a freshly loaded dataset — how big is it, and what are the columns called?

Your task. Write describe_shape(df) that returns a dict with three keys: "rows" (number of rows), "columns" (number of columns), "column_names" (list of column names in their original order).

Example. A 2×3 DataFrame with columns a, b, c → {"rows": 2, "columns": 3, "column_names": ["a", "b", "c"]}.

Notes. Works on any DataFrame, including empty ones (0 rows but columns still defined).

Previous
Build a DataFrame from Lists
Next
First N Rows