我有Profile
对象的ArrayList。 Profile
具有age
,gender
,country
等属性。
java中是否有任何库可以轻松提供描述性统计数据,例如女性档案数量,男性档案数量,美国女性档案数量以及其他复杂报告。
使用的环境是Google App Engine。
由于
答案 0 :(得分:4)
您可以在apache commons math中使用描述性统计数据,例如
// 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中。希望它有所帮助。
答案 1 :(得分:1)