Python Sort Array By Columns And Rows Sims