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