I'm trying to subtract the column average of an array from the respective column of the array using slicing and broadcasting. I don't understand how to transpose or why I need to, right now I have the given array Y.
Y_avg = Y.mean(axis=0)
Z = (Y.T - Y_avg).T
This is supposed to create an array that now has a column-wise average of 0. But that's not what I am getting