I have a list, say,
cc = {{0.16441114380905922, 1}, {0.16441114380905922, 2},
{-0.16441114381135857, 4}, {0.3469323902621586, 3},
{-0.3469323902254179, 2}, {-0.26126804383825986, 3},
{0.2612680438599802, 2}, {-0.28969854537720147, 3},
{0.28969854538168743, 2}, {-7.968690709137364, 3},
{7.968690708910122, 2}, {-4.000091496006696, 3},
{4.000091495616817, 2}, {4.729024444062355, 3},
{-4.72902444452141, 2}, {4.729024444062355, 1}}
I want to get the following information:
- all the $2\times1$ sub-lists with the same first element should be together (e.g., {x,y} and {x,z} should be together)
- multiplicity of the first elements
I am using Tally
and Sort
(also used GatherBy
) but not much help so far.
Thanks in advance.