I have just started working with numpy. while going through a sorting I came across np.ndarray.sum(-1).
the codes like this
rand_arr = np.random.rand(10, 2)
differences = rand_arr[:, np.newaxis, :] - rand_arr[np.newaxis, :, :]
so difference is a 3-D matrix of shape (10,10,2)
now they are using this command
difference.sum(-1) # this will convert the 3-D matrix into 2-D matrix of shape (10,10)
so what this .sum(-1) means exactly?