I wanted to ask a questions regarding merging multiindex dataframe in pandas, here is a hypothetical scenario:
arrays = [[\'bar\', \'bar\', \'baz\', \'baz\'
rename_axisYou can rename the index levels of one and let join do its thing
s1.join(s2.rename_axis(s1.index.names))
s1 s2
first second
bar one -0.696420 -1.040463
two 0.640891 1.483262
baz one 1.598837 0.097424
two 0.003994 -0.948419
foo one -0.717401 1.190019
two -1.201237 -0.000738
qux one 0.559684 -0.505640
two 1.979700 0.186013
concatpd.concat([s1, s2], axis=1)
s1 s2
first second
bar one -0.696420 -1.040463
two 0.640891 1.483262
baz one 1.598837 0.097424
two 0.003994 -0.948419
foo one -0.717401 1.190019
two -1.201237 -0.000738
qux one 0.559684 -0.505640
two 1.979700 0.186013