Tag Info

New answers tagged

2

The Join[] is across two datasets and only two. To make it easier to visualize I'll make the sets longer. With 2x2 it's easy to confuse up-down with left-right. asc1 = {<|a -> 1, b -> X|>, <|a -> 2, b -> Y|>, <|a -> 4, b -> bb|>, <| a -> 8, b -> 3|>}; asc2 = {<|a -> 1, c -> X|>, <|a ...


9

Currently in Mathematica v10 you need to be careful joining datasets as the Key[] function doesn't work with a string key for a dataset (it does for an association) . See Taliesin's comment below. Personally I think the help is a bit misleading referring to SQL joins with associations when they are more like "joins" in a NOSQL database. Examples of ...


4

Apologies if I misunderstand as I am not familiar with SQL but this seems to match your sole example: i1 = {<|a -> 1, b -> X|>, <|a -> 1, c -> Y|>}; i2 = {<|a -> 2, b -> XX|>, <|a -> 2, c -> YY|>}; Join @@@ {i1, i2} {<|a -> 1, b -> X, c -> Y|>, <|a -> 2, b -> XX, c -> YY|>}


3

I don't know how to make JoinAcross yield the result you ask for, but you can get it from Merge. Merge[#, Union /* First] & /@ {{<|a -> 1, b -> X|>, <|a -> 1, c -> Y|>}, {<|a -> 2, b -> XX|>, <|a -> 2, c -> YY|>}} {<|a -> 1, b -> X, c -> Y|>, <|a -> 2, b -> XX, c -> ...



Top 50 recent answers are included