## Fix Python – Most efficient way to find mode in numpy array

I have a 2D array containing integers (both positive or negative). Each row represents the values over time for a particular spatial site, whereas each column represents values for various spatial sites for a given time.

So if the array is like:

1 3 4 2 2 7

5 2 2 1 4 1

3 3 2 2 1 1

The result should be

1 3 2 2 2 1

Note that when there are multipl….