Given a list of numbers (could be huge file with integers) , Please provide the solution to calculate the **average** of those numbers.

P.S: This question is categorized under puzzles so think twice before posting your answer

Given a list of numbers (could be huge file with integers) , Please provide the solution to calculate the **average** of those numbers.

P.S: This question is categorized under puzzles so think twice before posting your answer

0 Likes

val data = sc.parallelize(List.range(0,100))

val sum = data.reduce(*+*)

val avg = sum.toFloat/data.count()

2 Likes