Closed
Description
Hi,
I would find it very helpful to be able to merge dataframes without common columns, (which is allowed in R), e.g.
x = DataFrame({'farm' : ['A','B','C']})
y = DataFrame({'crop':['wheat','millet']})
so that x.merge(y, how='outer')
returns:
farm crop
0 A wheat
1 A millet
2 B wheat
3 B millet
4 C wheat
5 C millet
Currently pandas returns: MergeError: No common columns to perform merge on
.
One work-around is to set the indices of x
and y
to zero, perform a join
and the reset the index, as per this StackOverflow post. Another use case is here.
Alternatively, if there is a better solution, please let me know. Thanks!