import random
df = pd.DataFrame({'x': random.sample(list(range(1, 100)), 4), 'y': random.sample
    (list(range(1, 100)), 4), 'z': random.sample(list(range(1, 100)), 4)}, index=[['a1',
    'b1', 'c1', 'd1'], ['a2', 'b2', 'c2', 'd2']])
df.iloc[0:3]
multiple row selection in multi indexed dataframe