Java Streams - Standard Deviation
I wish to clarify upfront I am looking for a way to calculate Standard deviation using Streams (I have a working method at present which calculates & returns SD but without using Streams). The dataset i am working with matches closely as seen in Link . As shown in this link am able to group my data & get the average but not able to figure out how to get the SD. Code outPut.stream() .collect(Collectors.groupingBy(e -> e.getCar(), Collectors.averagingDouble(e -> (e.getHigh() - e.getLow())))) .forEach((car,avgHLDifference) -> System.out.println(car+ "\t" + avgHLDifference)); I also checked Link