I don't have java (8) at my disposal at the moment, so can't
test anything.
But Campbells suggestion is the right direction.
First of all: if you are in these kind of calculations, my advice would be: use R.
But lacking this, my ideas are: (and you need javva 8 AND your professor should allow it)
1) make a method that converts a say double[] array into a Map<Integer, List<Double>>
Here, the integer is the group number, and the list contains the elements of the array within that group.
2) create a method that takes a List<Double> as input and delivers a DoubleSummaryStatistics
Combining 1) and 2) gives you easyily the statistics you are looking for.
And by varying this grouping, it is also easy to get these data for all of your observations.
3) a nice method would be one that converts a double[] intio a List<Double>. I'm not sure if a DoubleStream.of works with an array.
4) since you are working with a 2D array, it is easy to get the individual rows. However, from what you write it seems that you must also work with colums. Now, to my lnowledge, that is not so handy in java. So it would seem that a method would come in handy that, given a 2D array, delivers its transposed array. Mind you, that would only make sense if your 2D array is rectangular. If so, then working with a column would then simply be working with a row of the transposed.
I have some working code for this at home, but here in office I don't have java.
But I'm sure that if all this sounds reasonable, then folks around here will guide you further.