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.
What's wrong with
result = dataframe.mul(series, axis=0)
?