Examples

In [1]:
import numpy as np
import pandas as pd
In [2]:
s = pd.Series({'p': 2, 'q': 3, 'r': 4})
s.ndim
Out[2]:
1
In [3]:
df = pd.DataFrame({'c1': [2, 3], 'c2': [4, 5]})
df.ndim
Out[3]:
2