Near the means in BASH

Hello !!

I need some help :pensive: I have tow lists

1  -30.133 Orange
1  -6.576  Banana
1  -6.293   Apple
1  -12.034  Apricot
1  -7.076  Blackberry 

2  -4.355  Apple
2  -6.517  Banana
2  -6.355  Apricot
2  -3.502  Blackberry

and I have the means

1 -12.4224
2 -5.18225

For the groups, I would like to write : For the group 1, Apricot is the most near of the means and for the group 2, Apple is the most near of the means.

What do you mean by β€˜means’?

Hello !

I speak about the average

Got it. You can use the datamash command (datamash - GNU Project - Free Software Foundation) or R programming language to calculate the min, max, median, and average of from a list. You can use awk, perl, python and so on.