pandas.DataFrame.ndim() Function with example in python

Spread the love

DataFrame.ndim: This Function return an int representing the number of axes / array dimensions.

Return 1 if Series. Otherwise return 2 if DataFrame.

#example program on DataFrame.ndim() Function

import pandas as pd d = {'exp': [1, 2], 'salary': [10000, 15000]} df = pd.DataFrame(data=d) print(df.ndim)




Leave a Reply

Your email address will not be published. Required fields are marked *