I need to count the times a value example "2" is occurring in each column.
My dataset has this structure:
1 1 2 0 0 0 2
0 2 0 1 1 1 1
1 2 1 0 2 2 2
0 0 0 0 1 1 2
I imported the file:
val ip = sc.textFile("/home/../data-scala.txt").map(line => line.split(" "))
How I can sum up the value equal to "2" in each column? i would expect to have as result an array of elements as
[0,2,1,0,1,1,3]