question: public static float mean ( float [ ] data , int [ ] inds ) { float mean = 0 ; for ( int i = 0 ; i < inds . length ; i ++ ) { if ( Float . isNaN ( data [ inds [ i ] ] ) ) throw new IllegalArgumentException ( "NaN not allowed in mean calculation" ) ; mean += data [ inds [ i ] ] ; } mean /= inds . length ; return mean ; }
target:  Compute the mean of all elements in the array with given indices. No missing values (NaN) are allowed.