This question is somehow a part II of this: Part I.
Here comes a small data sample as a minimal working example:
{{-5.`, -3, 24.89`,
0.8079019748736321`, -1, -1}, {-4.977477477477477`, -3, 24.72`,
0.8100409238103935`, -1, 1}, {-4.954954954954955`, -3, 24.54`,
0.8122953345427153`, -1, 2}, {-4.932432432432432`, -3, 24.36`,
0.8145539903185015`, -1, 0}, {-4.90990990990991`, -3, 24.19`,
0.8167060089472148`, -1, -1}, {-4.887387387387387`, -3, 24.01`,
0.8189737833735357`, -1, -1}, {-4.864864864864865`, -3, 23.84`,
0.8211357279224385`, -1, -1}, {-4.842342342342342`, -3, 23.67`,
0.823303331789986`, -1, 0}, {-4.81981981981982`, -2, 23.5`,
0.8254770541856945`, -1, -1}, {-4.797297297297297`, -2, 23.32`,
0.8277682452908253`, -1, 2}, {-4.774774774774775`, -2, 23.15`,
0.8299553813547601`, -1, 1}, {-4.752252252252252`, -2, 22.98`,
0.8321495854317591`, -1, 2}, {-4.72972972972973`, -2, 22.82`,
0.8342399060011664`, -1, -1}, {-4.707207207207207`, -2, 22.65`,
0.8364482241698246`, -1, 2}, {-4.684684684684685`, -2, 22.48`,
0.8386633336338121`, -1, -1}, {-4.662162162162162`, -1, 22.31`,
0.8408848961319084`, -1, 0}, {-4.63963963963964`, -1, 22.15`,
0.843001699453557`, -1, 1}, {-4.617117117117117`, -1, 21.98`,
0.8452350102456677`, -1, 1}, {-4.594594594594595`, -1, 21.81`,
0.8474735570160751`, -1, 2}, {-4.572072072072072`, -1, 21.65`,
0.8496066341065539`, -1, 0}, {-4.54954954954955`, -1, 21.49`,
0.8517447815274005`, -1, 2}, {-4.527027027027027`, 0, 21.32`,
0.8539977804973352`, -1, -1}, {-4.504504504504505`, 0, 21.16`,
0.8561457246831677`, -1, 2}, {-4.481981981981982`, 0, 21.`,
0.8582989136727225`, -1, 1}, {-4.45945945945946`, 0, 20.83`,
0.8605668266689402`, -1, 0}, {-4.436936936936937`, 0, 20.67`,
0.862731269804195`, -1, -1}, {-4.414414414414415`, 1, 20.51`,
0.8649021245634532`, -1, 2}, {-4.391891891891892`, 1, 20.35`,
0.8670798666925034`, -1, -1}, {-4.36936936936937`, 1, 20.19`,
0.8692649521543424`, -1, 2}, {-4.346846846846847`, 1, 20.03`,
0.8714577803779188`, -1, 1}, {-4.324324324324325`, 1, 19.88`,
0.873550635695638`, -1, 0}, {-4.301801801801802`, 1, 19.72`,
0.8757599471643019`, -1, 0}, {-4.27927927927928`, 1, 19.56`,
0.8779776273998509`, -1, 1}}
This time we need only columns 1, 2, 3 and 6. The first column contains the x position, the second column the corresponding energy E, the third the time, while the sixth column has only integers regarding a classification.
Now I want to do the following. For every value of E we have several values of x with different classification. The possible integers of the sixth column are: {-1, 0, 1, 2}.
(a). I want to compute the mean value of the third column for the first value of E when the six column is either 1 or 2 (not -1 and 0). Then go to the next value of E and repeat the procedure. Thus we can follow the evolution of the mean value as a function of E.
(b). For the first value of E compute how many (the percentage) 1 and 2 with time (third column) < 23 exist. Then repeat this calculation for all the other values of E, so as to create a plot showing the evolution of this percentage as a function of E.
Any suggestions?