title: Create the cartesian product (cross join) of two csv files in python
body: <p>I tried to create a new csv file by cross joining two existing csv files.</p>
  
  <p>csv file #1:</p>
  
  <pre><code>hour    Elevation   Azimuth x   y   z   sunx    suny    sunz
  06:29:00    -0.833  67.72   0.379094033 0.925243946 -0.014538068    0.379094033 0.925243946 -0.014538068
  07:00:00    6.28    68.75   0.360264063 0.92641472  0.109387255 0.360264063 0.92641472  0.109387255
  </code></pre>
  
  <p>csv file #2:</p>
  
  <pre><code>ID  SURFACES    A1X A1Y A1Z A2X A2Y A2Z B1X B1Y B1Z B2X B2Y B2Z AX  AY  AZ  BX  BY  BZ  ABX ABY ABZ planex  planey  planez
  1   GROUND  800085.3323 961271.977  -3.07E-18   800080.8795 961246.1978 -3.07E-18   800097.1572 961269.9344 -3.07E-18   800085.3323 961271.977  -3.07E-18   4.4528  25.7792 0.00E+00    11.8249 -2.0426 0.00E+00    0   0   -313.9317514    0   0   -1
  2   ROOF    800019.3994 961242.7732 12  800021.442  961254.5981 12  800090.3488 961230.5181 12  800019.3994 961242.7732 12  -2.0426 -11.8249    0.00E+00    70.9494 -12.2551    0.00E+00    0   0   864.0018273 0
  </code></pre>
  
  <p>I want the cartesian product of the files (each hour with all surfaces, just like performing a SQL cross join).</p>
  
  <p>An illustration of what I am asking:<br>
  <a href="http://dotnetslackers.com/images/articleimages/sqljoins5.jpg" rel="nofollow">http://dotnetslackers.com/images/articleimages/sqljoins5.jpg</a></p>