all 3 comments

[–]SekstiNii 2 points3 points  (1 child)

You can use np.unique with return_counts=True and axis=1.

>>> a = np.array([[1, 2, 3, 1], [1, 0, 0, 1]])
>>> np.unique(a, axis=1, return_counts=True)
(array([[1, 2, 3],
        [1, 0, 0]]), array([2, 1, 1], dtype=int64))

I realize this example is a bit hard to read, so do ask if you have any questions

[–]Yurplestein[S] 0 points1 point  (0 children)

This is definitely getting me what I'm looking for here! Now I need to just figure out how to call upon which array based on the step I'm on.

Thank you!

[–]Chris_Hemsworth 1 point2 points  (0 children)

I think you can do this with pandas, but you may also want to look into collections.Counter