title: Is there a better way to get the product of values from all column combinations from two dataframes?
body: <p>I have two dataframes :</p>
  <pre><code>       (A0, B0, C0)  (A1, B1, C1)  (A2, B2, C2)
  Item0             6             6             4
  Item1             2             3             9
  
         (D0, E0)  (D1, E1)
  Item0         3         3
  Item1         7         5
  </code></pre>
  <p>I would like to get the product between values of each column from the first dataframe with every other column from the second dataframe, like this:</p>
  <pre><code>       (A0, B0, C0, D0, E0)  (A0, B0, C0, D1, E1)  (A1, B1, C1, D0, E0)  (A1, B1, C1, D1, E1)  (A2, B2, C2, D0, E0)  (A2, B2, C2, D1, E1)
  Item0                    18                    18                    18                    18                    12                    12
  Item1                    14                    10                    21                    15                    63                    45
  </code></pre>
  <p>I have come up with the following solution using pandas.concat and itertools.product (last two lines before the last prints, everything else is to setup the dataframes):</p>
  <pre><code>import pandas as pd
  import numpy as np
  import itertools
  from time import time
  
  t=time()
  
  nb_line=150
  nb_col1=6000
  nb_col2=50
  
  ind=[&quot;Item&quot;+str(i) for i in range(nb_line)]
  col1=[(&quot;A&quot;+str(i),&quot;B&quot;+str(i),&quot;C&quot;+str(i)) for i in range(nb_col1)]
  col2=[(&quot;D&quot;+str(i),&quot;E&quot;+str(i)) for i in range(nb_col2)]
  
  df1=pd.DataFrame(np.random.randint(10, size=(nb_line, nb_col1)),index=ind,columns=col1)
  df2=pd.DataFrame(np.random.randint(10, size=(nb_line, nb_col2)),index=ind,columns=col2)
  
  print(df1)
  print(df2)
  
  df=pd.concat([df1[i[0]]*df2[i[1]] for i in itertools.product(df1.columns,df2.columns)],axis=1)
  df.columns=[i[0]+i[1] for i in itertools.product(df1.columns,df2.columns)]
  
  print(df)
  print(time()-t)
  </code></pre>
  <p>This code runs in less than one minute on my machine which is acceptable but since I am new to pandas I am wondering if there is a better way to solve my problem.</p>