Find common elements in 2D numpy arrays
If I have two (or more) 2D arrays, how can I get only common elements between the arrays given a row number. For example, I have arrays in the format: time, position, velocity, acceleration I want to get the two arrays to only have the same time elements, so row 0. I can use np.intersect1d(array1[:, 0], array2[:, 0]) which gives all the common times, but I want to either extract all matching rows/columns from array1/2 or remove non common time elements. In the end array1 and array2 will have the exact same dimensions so I could go: pos_difference = array1[:, 1] - array2[:, 2] The arrays could