Cross join DataFrames

How can I cross join two dataframes A and B? In other words, combine every row in A with every row in B? I prefer not to do tricks like adding temporary columns.

use crossjoin:

  julia> df1 = DataFrame(X=1:3)
  3Ɨ1 DataFrame
   Row ā”‚ X
       ā”‚ Int64
  ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€
     1 ā”‚     1
     2 ā”‚     2
     3 ā”‚     3

  julia> df2 = DataFrame(Y=["a", "b"])
  2Ɨ1 DataFrame
   Row ā”‚ Y
       ā”‚ String
  ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€
     1 ā”‚ a
     2 ā”‚ b

  julia> crossjoin(df1, df2)
  6Ɨ2 DataFrame
   Row ā”‚ X      Y
       ā”‚ Int64  String
  ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€
     1 ā”‚     1  a
     2 ā”‚     1  b
     3 ā”‚     2  a
     4 ā”‚     2  b
     5 ā”‚     3  a
     6 ā”‚     3  b
3 Likes