Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
Return the Cartesian product of this RDD and another one, that is, the RDD of all pairs of elements (a, b) where a is in self and b is in other.
wayland
Programming language:
Python
2021-04-08 09:26:09
0
Q:
Return the Cartesian product of this RDD and another one, that is, the RDD of all pairs of elements (a, b) where a is in self and b is in other.
Ayoub. B
Code:
Python
2021-06-15 06:38:29
rdd = sc.parallelize([1, 2]) sorted(rdd.cartesian(rdd).collect()) # [(1, 1), (1, 2), (2, 1), (2, 2)]
0
Tags
element
turn
product
pair
return
another
Related
Returns the cartesian product with another DataFrame
Return a new RDD containing the distinct elements in this RDD.
Applies a function to all elements of this RDD.
Return the number of elements in this RDD.
sort list of dictionaries python by value
Return the intersection of this RDD and another one
write a function to return elements from two different lists, python
Return an RDD containing all pairs of elements with matching keys in self and other.
how to compare two lists element by element in python and return matched element
how to select number by twos in a list python next to each
Return an RDD created by coalescing all elements within each partition into a list.
how to generate 2d list in python of all same value
how get 1st column in all rows of a 2d matrix in python
New to Communities?
Join the community