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 Pandas DataFrame Notebooks from here.

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



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/pandas/dataframe/dataframe-ndim.php