JoinAcross[{a1,a2,…},{b1,b2,…},keyspec]
keyspec で指定される値が一致する,連想 aiと bjのペアを結合することによって得られる連想のリストを与える.
JoinAcross[tab1,tab2,keyspec]
keyspec に従って2つの表形式オブジェクトを結合する.
JoinAcross[prefix1obj1,prefix2obj2,keyspec]
ExtendedKey[prefixi,ckeyij]を使って objiのキーに prefixiを前置する.
JoinAcross[alist,blist,keyspec,"joinspec"]
joinspec を使って,欠落している要素を含む連想がいつ生成されるようにするかを決定する.
JoinAcross
JoinAcross[{a1,a2,…},{b1,b2,…},keyspec]
keyspec で指定される値が一致する,連想 aiと bjのペアを結合することによって得られる連想のリストを与える.
JoinAcross[tab1,tab2,keyspec]
keyspec に従って2つの表形式オブジェクトを結合する.
JoinAcross[prefix1obj1,prefix2obj2,keyspec]
ExtendedKey[prefixi,ckeyij]を使って objiのキーに prefixiを前置する.
JoinAcross[alist,blist,keyspec,"joinspec"]
joinspec を使って,欠落している要素を含む連想がいつ生成されるようにするかを決定する.
詳細とオプション
- JoinAcross[{a1,a2,…},{b1,b2,…},keyspec]は,事実上SQL JOINと同じものを実装し,keyspec で指定された列間で,行 ai と bj を持つ2つの表を結合する.
- JoinAcross[{a1,a2,…},{b1,b2,…},keyspec]の keyspec は,以下のいずれかでよい.
-
key key に関連付けられた値が等しい aiと bjを結合する {key1,key2,…} 各 keyiに関連付けられた値はすべて、マッチする各ペアで等しくなければならない keyakeyb aiの keyaに関連付けられた値は bjの keybに関連付けられた値と等しくなければならない {keya1keyb1,keya2keyb2,…} ai の keyaiに関連付けられた値と bjの keybjに関連付けられた値をマッチする func func[ai,bj]がTrueの時は常に,aiと bjのペアとを結合する - JoinAcross[{a1,a2,…},{b1,b2,…},keyspec]の keyspec は,事実上,以下の関数で置き換えられる.
-
key #1[key]===#2[key]& {key1,key2,…} #1[key1]===#2[key1]&[key2]===#2[key2]&&…& keyakeyb #1[keya]===#2[key2]& {keya1keyb1,keya2keyb2,…} #1[keya1]===#2[keyb1]&[keya2]===#2[keyb2]&&…& - JoinAcrossのキー指定は,それが文字列でなければKeyで囲まなければならない.
- JoinAcrossは事実上,フィルタを掛けられたFlatten[Outer[Join,alist,blist]]を生成する.
- デフォルトでJoinAcrossは,SQL的には,「内部結合」する.
- 次の形式の"joinspec"が,連想のペア aiと bjに異なる動作を指定する.
-
"Inner" 値がマッチする aiと bjのみを保つ(デフォルト) "Left" マッチする bjのない aiを許す "Right" マッチする ajのない biを許す "Outer" マッチしない aiと bjの両方を許す - 対応する値がない場合には,代りにMissing["Unmatched"]が使われる.
- JoinAcross[{a1,…},{b1,…},{},"joinspec"]と JoinAcross[{a1,…},{b1,…},True&,"joinspec"]は,事実上,Outer[Join,{a1,…},{b1,…}]都等しい. すべての aiとすべての bjがマッチするので,"joinspec"は無視される.
- オプションKeyCollisionFunctionを使って,結合するようには指定されていないにもかかわらず同じキーを持つ要素 aiおよび bjをどのように扱うかを指定することができる.
- KeyCollisionFunctionで使用可能な設定
-
None 両方の要素を除去する Left 左要素だけを含める(デフォルト) Right 右要素だけを含める func func を適用して新たなキーペアを生成する
例題
すべて開く すべて閉じる例 (10)
JoinAcross[{<|"Author" -> "Mark Twain", "YearOfBirth" -> 1835|>, <|"Author" -> "Jules Verne", "YearOfBirth" -> 1828|>}, {<|"Author" -> "Mark Twain", "Title" -> "Tom Sawyer"|>, <|"Author" -> "Mark Twain", "Title" -> "Huckleberry Finn"|>}, "Author"]Tabularオブジェクトを使って同じことを行う:
JoinAcross[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"YearOfBirth" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 21}, "Mark TwainJules Verne"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{1835, 1828}, {}, None}, "ElementType" -> "Integer64"]]}}]]]], Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"Title" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 20}, "Mark TwainMark Twain"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{3, {0, 10, 26}, "Tom SawyerHuckleberry Finn"}, {}, None},
"ElementType" -> "String"]]}}]]]], "Author"]JoinAcross[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["AuthorFirst" -> Association["ElementType" -> "String"],
"AuthorLast" -> Association["ElementType" -> "String"],
"YearOfBirth" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 4, 9}, "MarkJules"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{3, {0, 5, 10}, "TwainVerne"}, {}, None}, "ElementType" -> "String"]],
TabularColumn[Association["Data" -> {{1835, 1828}, {}, None}, "ElementType" ->
"Integer64"]]}}]]]], Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["AuthorFirst" -> Association["ElementType" -> "String"],
"AuthorLast" -> Association["ElementType" -> "String"],
"Title" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 4}, "Mark"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{3, {0, 5}, "Twain"}, {}, None}, "ElementType" -> "String"]],
TabularColumn[Association["Data" -> {{3, {0, 10}, "Tom Sawyer"}, {}, None},
"ElementType" -> "String"]]}}]]]], {"AuthorFirst", "AuthorLast"}]JoinAcross[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Name" -> Association["ElementType" -> "String"],
"YearOfBirth" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 21}, "Mark TwainJules Verne"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{1835, 1828}, {}, None}, "ElementType" -> "Integer64"]]}}]]]], Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"Title" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 21}, "Mark TwainJules Verne"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{3, {0, 10, 36}, "Tom SawyerFrom the Earth to the Moon"}, {}, None},
"ElementType" -> "String"]]}}]]]], "Name" -> "Author"]JoinAcross[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"YearOfDeath" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10}, "Mark Twain"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association["Data" -> {{1910}, {}, None},
"ElementType" -> "Integer64"]]}}]]]], Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"Title" -> Association["ElementType" -> "String"], "Publication" ->
Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 20, 30},
"Mark TwainMark TwainMark Twain"}, {}, None}, "ElementType" -> "String"]],
TabularColumn[Association["Data" -> {{3, {0, 10, 26, 49},
"Tom SawyerHuckleberry FinnThe Mysterious Stranger"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{1876, 1884, 1916}, {}, None}, "ElementType" -> "Integer64"]]}}]]]], #1["Author"] === #2["Author"] && #1["YearOfDeath"] < #2["Publication"]&]JoinAcross["Author" -> Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Name" -> Association["ElementType" -> "String"],
"YearOfBirth" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 21}, "Mark TwainJules Verne"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{1835, 1828}, {}, None}, "ElementType" -> "Integer64"]]}}]]]], "Book" -> Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"Name" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 20}, "Mark TwainMark Twain"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{3, {0, 10, 26}, "Tom SawyerHuckleberry Finn"}, {}, None},
"ElementType" -> "String"]]}}]]]], "Name" -> "Author"]"Inner"結合(デフォルト)では,マッチする連想のみが繋がれる:
JoinAcross[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"YearOfBirth" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 21}, "Mark TwainJules Verne"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{1835, 1828}, {}, None}, "ElementType" -> "Integer64"]]}}]]]], Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"Title" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 20, 34},
"Mark TwainMark TwainEmilio Salgari"}, {}, None}, "ElementType" -> "String"]],
TabularColumn[Association["Data" -> {{3, {0, 10, 26, 34},
"Tom SawyerHuckleberry FinnSandokan"}, {}, None}, "ElementType" -> "String"]]}}]]]], "Author", "Inner"]"Left"結合では,左側のリストからのマッチしない項目も含まれる:
JoinAcross[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"YearOfBirth" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 21}, "Mark TwainJules Verne"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{1835, 1828}, {}, None}, "ElementType" -> "Integer64"]]}}]]]], Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"Title" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 20, 34},
"Mark TwainMark TwainEmilio Salgari"}, {}, None}, "ElementType" -> "String"]],
TabularColumn[Association["Data" -> {{3, {0, 10, 26, 34},
"Tom SawyerHuckleberry FinnSandokan"}, {}, None}, "ElementType" -> "String"]]}}]]]], "Author", "Left"]"Right"結合では,右側のリストからのマッチしない項目も含まれる:
JoinAcross[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"YearOfBirth" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 21}, "Mark TwainJules Verne"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{1835, 1828}, {}, None}, "ElementType" -> "Integer64"]]}}]]]], Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"Title" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 20, 34},
"Mark TwainMark TwainEmilio Salgari"}, {}, None}, "ElementType" -> "String"]],
TabularColumn[Association["Data" -> {{3, {0, 10, 26, 34},
"Tom SawyerHuckleberry FinnSandokan"}, {}, None}, "ElementType" -> "String"]]}}]]]], "Author", "Right"]"Outer"結合では,マッチしないすべての項目が含まれる:
JoinAcross[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"YearOfBirth" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 21}, "Mark TwainJules Verne"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{1835, 1828}, {}, None}, "ElementType" -> "Integer64"]]}}]]]], Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"Title" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 20, 34},
"Mark TwainMark TwainEmilio Salgari"}, {}, None}, "ElementType" -> "String"]],
TabularColumn[Association["Data" -> {{3, {0, 10, 26, 34},
"Tom SawyerHuckleberry FinnSandokan"}, {}, None}, "ElementType" -> "String"]]}}]]]], "Author", "Outer"]スコープ (1)
JoinAcrossはSQLベースのTabularに使うことができる:
schema = RelationalDatabase[FindFile["ExampleData/ecommerce-database.sqlite"]]offices = Tabular[schema -> "offices"]employees = Tabular[schema -> "employees"]joined = JoinAcross["employees" -> employees, "offices" -> offices, "officeCode"]ToMemory[joined]オプション (3)
KeyCollisionFunction (3)
キー b のマッチングが結合に使われないときは,デフォルトで,このキーに対して左側の値が使われる:
JoinAcross[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Name" -> Association["ElementType" -> "String"],
"YearOfBirth" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 21}, "Mark TwainJules Verne"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{1835, 1828}, {}, None}, "ElementType" -> "Integer64"]]}}]]]], Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"Name" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 20}, "Mark TwainMark Twain"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{3, {0, 10, 26}, "Tom SawyerHuckleberry Finn"}, {}, None},
"ElementType" -> "String"]]}}]]]], "Name" -> "Author"]KeyCollisionFunctionを使って,衝突するどちらのキーの値を返すかを指定する:
JoinAcross[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Name" -> Association["ElementType" -> "String"],
"YearOfBirth" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 21}, "Mark TwainJules Verne"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{1835, 1828}, {}, None}, "ElementType" -> "Integer64"]]}}]]]], Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"Name" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 20}, "Mark TwainMark Twain"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{3, {0, 10, 26}, "Tom SawyerHuckleberry Finn"}, {}, None},
"ElementType" -> "String"]]}}]]]], "Name" -> "Author", KeyCollisionFunction -> Right]JoinAcross[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Name" -> Association["ElementType" -> "String"],
"YearOfBirth" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 21}, "Mark TwainJules Verne"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{1835, 1828}, {}, None}, "ElementType" -> "Integer64"]]}}]]]], Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"Name" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 20}, "Mark TwainMark Twain"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{3, {0, 10, 26}, "Tom SawyerHuckleberry Finn"}, {}, None},
"ElementType" -> "String"]]}}]]]], "Name" -> "Author", KeyCollisionFunction -> Function[x, {left[x], right[x]}]]JoinAcross[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Name" -> Association["ElementType" -> "String"],
"YearOfBirth" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 21}, "Mark TwainJules Verne"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{1835, 1828}, {}, None}, "ElementType" -> "Integer64"]]}}]]]], Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"Name" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 20}, "Mark TwainMark Twain"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{3, {0, 10, 26}, "Tom SawyerHuckleberry Finn"}, {}, None},
"ElementType" -> "String"]]}}]]]], "Name" -> "Author", KeyCollisionFunction -> None]特性と関係 (2)
場合によって,JoinAcrossをColumnwiseCombineと書き換えることができる:
JoinAcross[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"YearOfBirth" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 21}, "Mark TwainJules Verne"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{1835, 1828}, {}, None}, "ElementType" -> "Integer64"]]}}]]]], Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"Title" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 20}, "Mark TwainMark Twain"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{3, {0, 10, 26}, "Tom SawyerHuckleberry Finn"}, {}, None},
"ElementType" -> "String"]]}}]]]], "Author"]ColumnwiseCombine[{Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"YearOfBirth" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 21}, "Mark TwainJules Verne"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{1835, 1828}, {}, None}, "ElementType" -> "Integer64"]]}}]]]], Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Author" -> Association["ElementType" -> "String"],
"Title" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 10, 20}, "Mark TwainMark Twain"}, {}, None},
"ElementType" -> "String"]], TabularColumn[Association[
"Data" -> {{3, {0, 10, 26}, "Tom SawyerHuckleberry Finn"}, {}, None},
"ElementType" -> "String"]]}}]]]]} -> "Author"]JoinAcrossはCombinedEntityClassに等しい:
EntityValue[CombinedEntityClass["Isotope", EntityClass["Element", "Period1"], "Element" -> "Entity"], {EntityProperty["Isotope", "Element"], EntityProperty["Isotope", "Name"], EntityProperty["Isotope", "AtomicMass"], EntityProperty["Element", "Entity"], EntityProperty["Element", "AtomicMass"]}, "PropertyAssociation"]//TabularJoinAcross[EntityValue["Isotope", {EntityProperty["Isotope", "Element"], EntityProperty["Isotope", "Name"], EntityProperty["Isotope", "AtomicMass"]}, "PropertyAssociation"], EntityValue[EntityClass["Element", "Period1"], {EntityProperty["Element", "Entity"], EntityProperty["Element", "AtomicMass"]}, "PropertyAssociation"], EntityProperty["Isotope", "Element"] -> EntityProperty["Element", "Entity"]]//Tabular考えられる問題 (1)
キー a とキー b は結合のために使われていても衝突する:
JoinAcross[{<|a -> 1, b -> 2|>}, {<|a -> 2, b -> 1|>}, {Key[a] -> Key[b], Key[b] -> Key[a]}, "Left",
KeyCollisionFunction -> Function[x, {left[x], right[x]}]]キーが衝突すると,デフォルトで左側のキーからの値が取られる:
JoinAcross[{<|a -> 1, b -> 2|>}, {<|a -> 2, b -> 1|>}, {Key[a] -> Key[b], Key[b] -> Key[a]}, "Left"]JoinAcross[{<|a -> 1, b -> 2|>}, {<|a -> 2, b -> 1|>}, {Key[a] -> Key[b], Key[b] -> Key[a]}, "Left", KeyCollisionFunction -> Left]JoinAcross[{<|a -> 1, b -> 2|>}, {<|a -> 2, b -> 1|>}, {Key[a] -> Key[b], Key[b] -> Key[a]}, "Left", KeyCollisionFunction -> Right]関連するガイド
-
▪
- 連想 ▪
- 構造化されたデータ集合の計算 ▪
- 表形式の変換 ▪
- データ集合に対するデータベース様の操作
テキスト
Wolfram Research (2014), JoinAcross, Wolfram言語関数, https://reference.wolfram.com/language/ref/JoinAcross.html (2025年に更新).
CMS
Wolfram Language. 2014. "JoinAcross." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/JoinAcross.html.
APA
Wolfram Language. (2014). JoinAcross. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/JoinAcross.html
BibTeX
@misc{reference.wolfram_2026_joinacross, author="Wolfram Research", title="{JoinAcross}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/JoinAcross.html}", note=[Accessed: 29-October-2026]}
BibLaTeX
@online{reference.wolfram_2026_joinacross, organization={Wolfram Research}, title={JoinAcross}, year={2025}, url={https://reference.wolfram.com/language/ref/JoinAcross.html}, note=[Accessed: 29-October-2026]}