which is the fastest way to achieve the following:
I'm using a Pandas Dataframe (NxN) and i want to iterate over each row and each element to check if the element is greater than the rows mean. If it is greater i want to change the element value to 1.
I calculate the mean value using :
mean_value = df.ix[elementid].mean(axis=0)
but iterating over each element and checking if it is >= mean_value with a nested loop is really slow.