Skip to content
Advertisement

Spark Calculate Standard deviation row wise

I need to calculate Standard deviation row wise assuming that I already have a column with calculated mean per row.I tried this

JavaScript

but I got the following error

JavaScript

Advertisement

Answer

Your code is completely mixed up (at its current state it won’t even cause the exception you described in the question). sqrt should be placed outside reduce call:

JavaScript
Advertisement