java - Java ArrayList 的描述性统计

标签 java google-app-engine arraylist

我有 Profile 对象的 ArrayList。 Profile 具有agegendercountry 等属性。

java中有没有什么库可以方便的给出描述性统计数据,比如女性资料的数量,男性资料的数量,来自美国的女性资料的数量,以及其他复杂的报告。

使用的环境是Google App Engine。

谢谢

最佳答案

您可以在 apache commons 数学中使用描述性统计信息,例如

// Get a DescriptiveStatistics instance
DescriptiveStatistics stats = new DescriptiveStatistics();

// Add the data from the array
for( int i = 0; i < inputArray.length; i++) {
        stats.addValue(inputArray[i]);
}

// Compute some statistics
double mean = stats.getMean();
double std = stats.getStandardDeviation();

您需要将性别/国家/地区信息添加到 commons math 提供的 descriptiveStatistics 中。希望对您有所帮助。

关于java - Java ArrayList 的描述性统计,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14269392/

相关文章:

java - 为什么Java中的Set数据结构内部使用Map?

java - @NonNull 和@Nullable 的正确用法是什么?

google-app-engine - Error RecognitionConfig 必须未指定或与 google speech to text api 中的 FLAC header 音频中的值匹配

google-app-engine - 查询 KeyProperty 的父/祖先

java - java中Arraylist<Integer>的ArrayList的字典排序

java - AChartEngine 绘图、ArrayList 索引

java - 将额外代码插入 Java for 循环

java - 将文本行添加到文本文件的最佳策略

google-app-engine - 关系数据模型到 Google 数据存储映射

arrays - 如何从PowerShell中的数组中删除项目?