🔵 🔵 🔵


Primary

၊၊||၊|။

DataFrame.shape ⚬|Documentation|1st|20251021 002612-00-⌔

pandas.DataFrame.shape — pandas 2.3.3 documentation#pandas.DataFrame.shape

property DataFrame.shape

Return a tuple representing the dimensionality of the DataFrame.

Unlike the len() method, which only returns the number of rows, shape provides both row and column counts, making it a more informative method for understanding dataset size.

See also:
numpy.ndarray.shape

Tuple of array dimensions.

Examples:
>>> df = pd.DataFrame({"col1": [1, 2], "col2": [3, 4]})
>>> df.shape
(2, 2)
>>> df = pd.DataFrame({"col1": [1, 2], "col2": [3, 4], "col3": [5, 6]})
>>> df.shape
(2, 3)

Printed 2026-06-28.

(echo:: @ )

Link to original

Secondary

• • •