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")
| 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 | """ |