pandas dataframe multiply with a series [duplicate]
问题 This question already has answers here : How do I operate on a DataFrame with a Series for every column (2 answers) Closed 10 months ago . 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. 回答1: What's wrong with result = dataframe.mul(series, axis=0) ?