MCPcopy Create free account
hub / github.com/EntilZha/PyFunctional / join

Method join

functional/pipeline.py:1170–1198  ·  view source on GitHub ↗

Sequence and other must be composed of (Key, Value) pairs. If self.sequence contains (K, V) pairs and other contains (K, W) pairs, the return result is a sequence of (K, (V, W)) pairs. If join_type is "left", V values will always be present, W values may be present or None.

(self, other, join_type="inner")

Source from the content-addressed store, hash-verified

1168 return self.join(other, "inner")
1169
1170 def join(self, other, join_type="inner"):
1171 """
1172 Sequence and other must be composed of (Key, Value) pairs. If self.sequence contains (K, V)
1173 pairs and other contains (K, W) pairs, the return result is a sequence of (K, (V, W)) pairs.
1174 If join_type is "left", V values will always be present, W values may be present or None.
1175 If join_type is "right", W values will always be present, W values may be present or None.
1176 If join_type is "outer", V or W may be present or None,
1177 but never at the same time.
1178
1179 >>> seq([('a', 1), ('b', 2), ('c', 3)]).join([('a', 2), ('c', 5)], "inner")
1180 [('a', (1, 2)), ('c', (3, 5))]
1181
1182 >>> seq([('a', 1), ('b', 2), ('c', 3)]).join([('a', 2), ('c', 5)])
1183 [('a', (1, 2)), ('c', (3, 5))]
1184
1185 >>> seq([('a', 1), ('b', 2)]).join([('a', 3), ('c', 4)], "left")
1186 [('a', (1, 3)), ('b', (2, None)]
1187
1188 >>> seq([('a', 1), ('b', 2)]).join([('a', 3), ('c', 4)], "right")
1189 [('a', (1, 3)), ('c', (None, 4)]
1190
1191 >>> seq([('a', 1), ('b', 2)]).join([('a', 3), ('c', 4)], "outer")
1192 [('a', (1, 3)), ('b', (2, None)), ('c', (None, 4))]
1193
1194 :param other: sequence to join with
1195 :param join_type: specifies join_type, may be "left", "right", or "outer"
1196 :return: side joined sequence of (K, (V, W)) pairs
1197 """
1198 return self._transform(transformations.join_t(other, join_type))
1199
1200 def left_join(self, other):
1201 """

Callers 14

inner_joinMethod · 0.95
left_joinMethod · 0.95
right_joinMethod · 0.95
outer_joinMethod · 0.95
make_stringMethod · 0.80
_insert_itemMethod · 0.80
openMethod · 0.80
__repr__Method · 0.80
test_openMethod · 0.80
test_inner_joinMethod · 0.80
test_left_joinMethod · 0.80
test_right_joinMethod · 0.80

Calls 1

_transformMethod · 0.95

Tested by 6

test_openMethod · 0.64
test_inner_joinMethod · 0.64
test_left_joinMethod · 0.64
test_right_joinMethod · 0.64
test_outer_joinMethod · 0.64
test_joinMethod · 0.64