w3resource

Pandas DataFrame property: ndim

DataFrame - ndim property

The ndim property is used to get an int representing the number of axes / array dimensions.

Return 1 if Series. Otherwise return 2 if DataFrame.

Syntax:

DataFrame.ndim

Example:


Download the above Notebook from here.

Previous: DataFrame - axes property
Next: DataFrame - size property