how to multiply pandas dataframe with numpy array with broadcasting
I find an alternative way to do the multiplication between pandas dataframe and numpy array.
In [14]: x.multiply(y, axis=0)
Out[14]:
0 1 2
0 0.195346 0.443061 1.219465
1 0.194664 0.242829 0.180010
2 0.803349 0.091412 0.098843
3 0.365711 -0.388115 0.018941
I think you are better off using the df.apply() method. In your case:
x.apply(lambda x: x * y)