shape

dataframe

Returns the dimensions (rows, columns) of a DataFrame

Syntax

shape(dataframe)

Parameters

dataframe (dataframe)

The DataFrame to get dimensions from

Returns

array

Array with two elements [rows, columns]

Examples

Returns dimensions showing 100 rows and 4 columns
Input:
shape
Output:
[100, 4]

The shape() function returns the dimensions of a DataFrame as a two-element array containing the number of rows and columns.

Usage

Use shape() to quickly understand the size of your dataset, validate data loading, or check the result of filtering operations.

Related Functions