I have a multidimensional numpy array that I want to split based on a particular column.
Ex. [[1,0,2,3],[1,2,3,4],[2,3,4,5]]
Say I want to split this array by the 2nd column with the expression x <=2. Then I would get two arrays [[1,0,2,3],[1,2,3,4]] and [[2,3,4,5]].
I am currently using this statement, which I don't think is correct.
splits = np.split(S, np.where(S[:, a] <= t)[0][:1]) #splits S based on t
#a is the column number
x<=2? Isxyour row number?[1, 0, 2, 3], [1, 2, 3, 4]stay together because you compare0 <= 2and2 <= 2.[2, 3, 4, 5]is "split" because you compare3 <= 2. Correct?