简体   繁体   English

如何将双数组转换为集合?

[英]how to convert double array to collection?

I have two arrays 我有两个数组

   double arr[]=data.attributeToDoubleArray(4);
   double arr0[]=data.attributeToDoubleArray(0);

To calculate p value in common apache it has been documented as follows : 要计算常用ap中的p值,已记录如下:

 public double anovaPValue(Collection<double[]> categoryData)
               throws NullArgumentException,
                      DimensionMismatchException,
                      ConvergenceException,
                      MaxCountExceededException

       Computes the ANOVA P-value for a collection of double[] arrays.
       Preconditions:

        The categoryData Collection must contain double[] arrays.
        There must be at least two double[] arrays in the categoryData collection and each of these arrays must contain at least two values.

How can I convert my two arrays in collection so that I can use the above function ? 如何转换集合中的两个数组,以便可以使用上述函数?

you can try this: 您可以尝试以下方法:

double arr[]=data.attributeToDoubleArray(4);
double arr0[]=data.attributeToDoubleArray(0);

List<double[]> newArr = Arrays.asList(arr, arr0);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM