Wednesday, 1 April 2020

TableSaw: Standard Deviation of a column

‘standardDeviation’method returns standard deviation of a column.

Example
int[] numbers = { 23, 45, 6, 32, 1, 43, 1, 45, 6, 1, 1 };

IntColumn numbersColumn = IntColumn.create("My Numbers", numbers);

double standardDeviation = numbersColumn.standardDeviation();

App.java
package com.sample.app;

import tech.tablesaw.api.IntColumn;

public class App {

 public static void main(String args[]) {
  int[] numbers = { 23, 45, 6, 32, 1, 43, 1, 45, 6, 1, 1 };

  IntColumn numbersColumn = IntColumn.create("My Numbers", numbers);

  double standardDeviation = numbersColumn.standardDeviation();

  System.out.println("standardDeviation : " + standardDeviation);
 }
}

Output
standardDeviation : 19.35129781882154




Previous                                                    Next                                                    Home

No comments:

Post a Comment