title: Pandas: Elementwise multiplication of two dataframes
body: <p>I know how to do element by element multiplication between two Pandas dataframes. However, things get more complicated when the dimensions of the two dataframes are not compatible. For instance below <code>df * df2</code> is straightforward, but <code>df * df3</code> is a problem:</p>
  
  <pre><code>df = pd.DataFrame({'col1' : [1.0] * 5, 
                     'col2' : [2.0] * 5, 
                     'col3' : [3.0] * 5 }, index = range(1,6),)
  df2 = pd.DataFrame({'col1' : [10.0] * 5, 
                      'col2' : [100.0] * 5, 
                      'col3' : [1000.0] * 5 }, index = range(1,6),)
  df3 = pd.DataFrame({'col1' : [0.1] * 5}, index = range(1,6),)
  
  df.mul(df2, 1) # element by element multiplication no problems
  
  df.mul(df3, 1) # df(row*col) is not equal to df3(row*col)
     col1  col2  col3
  1   0.1   NaN   NaN
  2   0.1   NaN   NaN
  3   0.1   NaN   NaN
  4   0.1   NaN   NaN
  5   0.1   NaN   NaN
  </code></pre>
  
  <p>In the above situation, <strong>how can I multiply every column of df with df3.col1</strong>?</p>
  
  <p><strong>My attempt:</strong> I tried to replicate <code>df3.col1</code>  <code>len(df.columns.values)</code> times to get a dataframe that is of the same dimension as <code>df</code>:</p>
  
  <pre><code>df3 = pd.DataFrame([df3.col1 for n in range(len(df.columns.values)) ])
  df3
          1    2    3    4    5
  col1  0.1  0.1  0.1  0.1  0.1
  col1  0.1  0.1  0.1  0.1  0.1
  col1  0.1  0.1  0.1  0.1  0.1
  </code></pre>
  
  <p>But this creates a dataframe of dimensions 3 * 5, whereas I am after 5*3. I know I can take the transpose with <code>df3.T()</code> to get what I need but I think this is not that the fastest way.</p>