Thanks for your answer. But it is not what I want. The result I want, [ [2], [1, 3] ], reflects that the element 2 is selected from the first column of [ [0, 1], [2, 3], [0, 0] ], and the elements 1 and 3 are selected from the second column of [ [0, 1], [2, 3], [0, 0] ].