Pregunta de entrevista de Barclays

How to combine dataframes row wise and column wise