I'm not sure what you want to achieve, but...
Suppose you want to sort dictionary values based on its occurence.
Here is an example:
Dictionary<int, double[]> d = new Dictionary<int,double[]>()
{
{1, new double[]{.5, 1.2, 3.4, .5, 1.2, 3.4, .5, 1.2, 3.4, .5, 1.2}},
{2, new double[]{.5, 1.2, 3.4, .5, 1.2, 3.4, .5, 1.2, 3.4, .5, 1.2, 3.4, 3.4}},
{3, new double[]{.5, 1.2, 3.4, .5, 1.2, 3.4}},
{4, new double[]{.5, 1.2, 3.4, 3.4, 3.4, .5, 1.2, 3.4, .5, 3.4}},
{5, new double[]{.5, 1.2, 3.4}}
};
Dictionary<int, Dictionary<double, int>> result = d
.Select(x=> new KeyValuePair<int, Dictionary<double, int>>
(x.Key, new Dictionary<double, int>(x.Value.GroupBy(y => y)
.Select(g => new KeyValuePair<double, int>(g.Key, g.Count()))
.OrderByDescending(k => k.Value)
.ToDictionary(kvp => kvp.Key, kvp => kvp.Value))))
.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Result:
Key Values
1 0.5 | 4
1.2 | 4
3.4 | 3
2 3.4 | 5
0,5 | 4
1,2 | 4
and so on...