pandas dataframe multiply with a series

jianpan picture jianpan · Oct 31, 2012 · Viewed 40.8k times · Source

What is the best way to multiply all the columns of a Pandas DataFrame by a column vector stored in a Series? I used to do this in Matlab with repmat(), which doesn't exist in Pandas. I can use np.tile(), but it looks ugly to convert the data structure back and forth each time.

Thanks.

Answer