Pandas > Create multi-index dataframe

Name
Code
Output
# muti index contains multiple numpy arrays

multi_index = [numpy.array(['Alpha','Beta','Gamma','Alpha','Beta']), numpy.array([1,2,3,4,5])]
dataframe = pandas.DataFrame(numpy.random.randint(0,10,size=(5, 3)), columns=['C1','C2','C3'],index = multi_index)
print ("dataframe")
print (dataframe)
print ("rows Alpha")
print (dataframe.loc['Alpha'])
print ("row Alpha 4")
print (dataframe.loc['Alpha',4])
dataframe
         C1  C2  C3
Alpha 1   7   7   6
Beta  2   9   3   1
Gamma 3   7   4   8
Alpha 4   7   3   2
Beta  5   4   1   3
rows Alpha
   C1  C2  C3
1   7   7   6
4   7   3   2
row Alpha 4
C1    7
C2    3
C3    2
Name: (Alpha, 4), dtype: int64