Good morning, I have an input dataset in the following form:
data={{{team1,team4},{{0.0356739,0.0460788,0.0297593,0.048},{0.0728342,0.0940777,0.0607586,0.052},{0.0743518,0.0960378,0.0620245,0.0238}}},{{team3,team2},{{0.0356739,0.0728342,0.0743518,0.0238},{0.0460788,0.0940777,0.0960378,0.0133},{0.0297593, 0.0607586,0.0620245,0.0148}}},{{team5,team6},{{0.0639281,0.0879008,0.0604318,0.01438},{0.0879008,0.120863,0.0830935,0.03438},{0.0604318,0.0830935,0.0571267,0.05438}}}}
I would like to create a function to obtain the following output table:
output={data[[k,1]],1,X,2}
where the kth data[[k,1]]={team_k1,team_k2}
represents the kth match and the kth event 1,X,2 represents the events home victory, draw, away victory for the kth match.
So, the rules for these events are the following:
1: If[i>j,Sum[data[[k,2,i,j]]...{i,1,Length[data[[1,2,1]]]},{j,1,Length[data[[1,2,1]]]}
X: If[i=j,Sum[data[[k,2,i,j]]...{i,1,Length[data[[1,2,1]]]},{j,1,Length[data[[1,2,1]]]}
2: If[i<j,Sum[data[[k,2,i,j]]...{i,1,Length[data[[1,2,1]]]},{j,1,Length[data[[1,2,1]]]}