<prompt> Write a Python function to sort a two-dimensional array based on a given column indexArray 1,2,3, 4,5,6, 7,8,9Column index 2  <response>: pythondef sort_array_by_columnarr, col_index: return sortedarr, keylambda x: xcol_indexExampleif __name__ __main__: my_arr 1,2,3, 7,8,9, 4,5,6 col_Index 2 printsort_array_by_columnmy_arr, col_Index This would return : 1, 2, 3, 4, 5, 6, 7, 8, 9This function takes a two dimensional array arr and an integer col_index representing the column index to sort on as inputs, and returns a new array with the rows sorted based on the value at column col_index in ascending order. 