Basically, I would like to create a new data frame from some existing data frames by creating all the possible column combinations. This is quite easy in SAS
(or expand.grid
function in R
):
create table combine_var as
select *
from var_1, avar_2;
But I am not sure, what is the equalent way in Python. For instance, my data frame looks like:
var_1= pd.DataFrame.from_items([('val_1', [0.00789, 0.01448, 0.03157])])
var_2= pd.DataFrame.from_items([('val_2', [0.5, 1.0])])
And I expect the output is:
val_1 val_2
0.00789 0.5
0.00789 1.0
0.01448 0.5
0.01448 1.0
0.03157 0.5
0.03157 1.0