To rationalize the denominator of , you should multiply the expression by which fraction? code example

Example 1: Use multiple conditional operators in the checkSign function to check if a number is positive, negative or zero. The function should return "positive", "negative" or "zero".

function checkSign(num) {
  return (num > 0) ? 'positive' : (num < 0) ? 'negative' : 'zero';
}

Example 2: 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.

rdd = sc.parallelize([1, 2])
sorted(rdd.cartesian(rdd).collect())
# [(1, 1), (1, 2), (2, 1), (2, 2)]

Tags:

Go Example