Let's say I have a numpy df such as
X = pd.DataFrame(np.array([
[ 9., 12., 4.],
[ 1., 31., 3.],
[ 6., 4., 1.]]) )
I want to divide each entry by the row sum * column sum. I know I can get row and column sum, respectively, using X.sum() and X.sum(1) but I don't know how to do the operation I'm seeking aside from looping through each entry brute force.