Use the DataFrame div
method and pass matchkey for the multi-index you want to broadcast across:
From the documentation for div
:
level : int or name
Broadcast across a level, matching Index values on the
passed MultiIndex level
In [39]: concentration.div(weight, level="Land Use")
Out[39]:
1E 1N 1S 2
Land Use Parameter
Airfield BOD5 (mg/l) 0.818004 5.198238 3.668831 2.697970
Ortho P (mg/l) 0.003914 0.044053 0.016234 0.005076
TSS (mg/l) 3.469667 505.286344 13.993506 0.464467
Zn (mg/l) 0.001957 0.044053 0.000804 0.002538
Commercial BOD5 (mg/l) 72.000000 0.245892 NaN 2.957746
Cu (mg/l) 0.087400 0.000431 NaN 0.003662
O&G (mg/l) 77.000000 0.745305 NaN 2.469484
Open Space TSS (mg/l) 463.750000 602.000000 6045.000000 367.500000
Zn (mg/l) 15.875000 1.380000 66.000000 17.500000
Parking Lot BOD5 (mg/l) 2.800000 0.129961 10.329365 18.654971
O&G (mg/l) 3.090909 0.289883 5.345238 10.994152
Rooftops BOD5 (mg/l) 1.666667 35.714286 661.176471 103.333333