diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 72fc099f57599..57a7b9467a05e 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -1021,6 +1021,10 @@ def shape(self) -> tuple[int, int]: """ 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.