data=Import["34OC-IN Notes.xls"]

Traitement de données

En écrivant data = devant la liste, on effectue une affectation. Toutes les valeurs de la liste se trouvent, après évaluation de la cellule, dans la variable data. En plaçant un ; à la fin de la liste, on supprime l'affichage de cette dernière lors de l'évaluation.

data={{{"Prénom","Nom","Numéro d'identification","Institution","Département","Adresse de courriel","Test&nbsp;Premiers pas dans les iLES","Test&nbsp;Internet et le Web","Test&nbsp;Rechercher sur la toile","Test&nbsp;Rechercher avec Wolfram Alpha","Test&nbsp;Impact social d'Internet","Test&nbsp;Outils de publication sur Internet","Test&nbsp;Structure de Mathematica","Test&nbsp;Affectations, règles et motifs","Test&nbsp;Langages de programmation","Rédaction SPIP","Test&nbsp;Epreuve OCinf","Total du cours"},{"Teo","Armici","","","","teo.armici@gmail.com",5.17`,4.63`,5.`,3.69`,4.2`,6.`,5.25`,4.04`,4.91`,4.5`,"-",78.63`},{"Valentin","Burdet","","","","valentin.895@hotmail.com",4.97`,3.46`,4.87`,4.31`,4.71`,6.`,4.03`,1.5`,1.`,1.`,"-",59.07`},{"Daniela","Camara Angulo","","","","daniela7294@hotmail.com",3.5`,"-",4.2`,3.19`,5.51`,5.25`,3.72`,5.38`,4.52`,5.`,"-",74.08`},{"Séverine","Comtat","","","","s_comtat@hotmail.fr",4.43`,"-",4.13`,3.04`,6.`,6.`,3.56`,4.84`,3.94`,1.`,"-",67.83`},{"Rafael","Dias Pereira","","","","carouge1994@hotmail.com",5.33`,"-",4.67`,"-",6.`,6.`,4.28`,4.02`,4.28`,1.`,"-",73.58`},{"Hélène","Du","","","","ely.duong@hotmail.com",4.4`,"-",4.13`,3.58`,5.43`,4.05`,3.13`,5.24`,4.85`,1.`,"-",65.67`},{"Lakkat","Haas Strauf","","","","l@i-les.ch","-","-","-","-","-","-","-","-","-","-","-","-"},{"Shineka","Logeswaran","","","","shineka_21@hotmail.com",2.97`,2.71`,3.93`,3.5`,4.94`,6.`,3.84`,4.04`,4.32`,4.`,"-",66.54`},{"Abel","Mahari","","","","abel213@hotmail.fr",5.43`,"-",5.17`,3.81`,5.54`,6.`,4.56`,1.`,5.17`,4.5`,"-",75.82`},{"Patrick","Merminod","","","","patrick.merminod@edu.ge.ch","-","-","-","-","-","-","-","-","-","-","-","-"},{"Omair","Moghis","","","","omoghis@gmail.com",4.83`,3.91`,4.4`,3.69`,4.03`,5.1`,5.38`,1.`,1.`,1.`,"-",56.5`},{"Dany","Morim","","","","dany-1203@hotmail.fr",4.13`,5.31`,5.67`,5.55`,5.63`,5.25`,3.81`,4.83`,5.49`,5.5`,"-",85.03`},{"Diego","Parodi","","","","cesar-uruguay@hotmail.com",4.6`,"-","-",4.69`,5.54`,5.4`,3.16`,5.2`,1.59`,1.`,"-",64.2`},{"Melissa","Rigotti","","","","melissa.jimi@gmail.com",3.5`,2.97`,3.9`,3.55`,5.53`,3.6`,4.`,5.14`,4.4`,1.`,"-",62.01`},{"Marie-Anne","Saad","","","","marie-anne.saad@hotmail.com",4.68`,3.37`,5.33`,4.38`,4.16`,5.7`,4.31`,2.44`,3.59`,5.5`,"-",71.96`},{"Romain","Sanna","","","","romain.loki@gmail.com",4.77`,4.92`,6.`,4.63`,6.`,5.85`,4.5`,2.59`,3.53`,1.`,"-",72.5`},{"Matthieu","Vallotton","","","","matt_95@windowslive.com",4.7`,3.98`,5.27`,4.56`,6.`,6.`,4.97`,2.45`,4.38`,1.`,"-",71.71`},{"Federico","Vitali","","","","fede_ita_93@hotmail.fr",4.23`,3.81`,3.93`,4.`,4.41`,5.85`,5.31`,3.26`,4.06`,5.5`,"-",73.51`}}};

Cette liste est constituée de sous - listes. La longeur de cette liste est 1, car elle comporte une sous-liste qui contient toutes les autres

Length[data]

Pour accéder à cette sous - liste on écrit  data[[1]] et on la place dans une nouvelle variable data1

data1=data[[1]]

Cette fonction donnne le nombre de sous listes (ou d' éléments dans une liste)

Length[data1]

data1[[9]]

Pour obtenir la position d' un élément dans une liste

Position[data1,"Federico"]

Position[data1,"Federico"][[1]]

Position[data1,"Federico"][[1,1]]

En utilisant cettte syntaxe, on parvient à isoler l'élément "Federico"

data1[[Position[data1,"Federico"][[1,1]]]]

On souhaite isoler uniquement les notes (nombres)

Select[data1[[Position[data1,"Federico"][[1,1]]]],NumberQ[#]&]

NumberQ[#] & est une fonction qui teste les éléments de la liste et qui retourne True s'il s'agit d'un nombre

Le dernier nombre de la liste dont être retiré. On définit comme précédemment une fonction qui test s'il s'agit d'un nombre et s'il est inférieur ou égal à 6

Select[data1[[Position[data1,"Federico"][[1,1]]]],#<=6&]

Mean[%]

Assemblons en un petit programme ces quelques lignes

Liste donnée

data1={{"Prénom","Nom","Numéro d'identification","Institution","Département","Adresse de courriel","Test&nbsp;Premiers pas dans les iLES","Test&nbsp;Internet et le Web","Test&nbsp;Rechercher sur la toile","Test&nbsp;Rechercher avec Wolfram Alpha","Test&nbsp;Impact social d'Internet","Test&nbsp;Outils de publication sur Internet","Test&nbsp;Structure de Mathematica","Test&nbsp;Affectations, règles et motifs","Test&nbsp;Langages de programmation","Rédaction SPIP","Test&nbsp;Epreuve OCinf","Total du cours"},{"Teo","Armici","","","","teo.armici@gmail.com",5.17`,4.63`,5.`,3.69`,4.2`,6.`,5.25`,4.04`,4.91`,4.5`,"-",78.63`},{"Valentin","Burdet","","","","valentin.895@hotmail.com",4.97`,3.46`,4.87`,4.31`,4.71`,6.`,4.03`,1.5`,1.`,1.`,"-",59.07`},{"Daniela","Camara Angulo","","","","daniela7294@hotmail.com",3.5`,"-",4.2`,3.19`,5.51`,5.25`,3.72`,5.38`,4.52`,5.`,"-",74.08`},{"Séverine","Comtat","","","","s_comtat@hotmail.fr",4.43`,"-",4.13`,3.04`,6.`,6.`,3.56`,4.84`,3.94`,1.`,"-",67.83`},{"Rafael","Dias Pereira","","","","carouge1994@hotmail.com",5.33`,"-",4.67`,"-",6.`,6.`,4.28`,4.02`,4.28`,1.`,"-",73.58`},{"Hélène","Du","","","","ely.duong@hotmail.com",4.4`,"-",4.13`,3.58`,5.43`,4.05`,3.13`,5.24`,4.85`,1.`,"-",65.67`},{"Lakkat","Haas Strauf","","","","l@i-les.ch","-","-","-","-","-","-","-","-","-","-","-","-"},{"Shineka","Logeswaran","","","","shineka_21@hotmail.com",2.97`,2.71`,3.93`,3.5`,4.94`,6.`,3.84`,4.04`,4.32`,4.`,"-",66.54`},{"Abel","Mahari","","","","abel213@hotmail.fr",5.43`,"-",5.17`,3.81`,5.54`,6.`,4.56`,1.`,5.17`,4.5`,"-",75.82`},{"Patrick","Merminod","","","","patrick.merminod@edu.ge.ch","-","-","-","-","-","-","-","-","-","-","-","-"},{"Omair","Moghis","","","","omoghis@gmail.com",4.83`,3.91`,4.4`,3.69`,4.03`,5.1`,5.38`,1.`,1.`,1.`,"-",56.5`},{"Dany","Morim","","","","dany-1203@hotmail.fr",4.13`,5.31`,5.67`,5.55`,5.63`,5.25`,3.81`,4.83`,5.49`,5.5`,"-",85.03`},{"Diego","Parodi","","","","cesar-uruguay@hotmail.com",4.6`,"-","-",4.69`,5.54`,5.4`,3.16`,5.2`,1.59`,1.`,"-",64.2`},{"Melissa","Rigotti","","","","melissa.jimi@gmail.com",3.5`,2.97`,3.9`,3.55`,5.53`,3.6`,4.`,5.14`,4.4`,1.`,"-",62.01`},{"Marie-Anne","Saad","","","","marie-anne.saad@hotmail.com",4.68`,3.37`,5.33`,4.38`,4.16`,5.7`,4.31`,2.44`,3.59`,5.5`,"-",71.96`},{"Romain","Sanna","","","","romain.loki@gmail.com",4.77`,4.92`,6.`,4.63`,6.`,5.85`,4.5`,2.59`,3.53`,1.`,"-",72.5`},{"Matthieu","Vallotton","","","","matt_95@windowslive.com",4.7`,3.98`,5.27`,4.56`,6.`,6.`,4.97`,2.45`,4.38`,1.`,"-",71.71`},{"Federico","Vitali","","","","fede_ita_93@hotmail.fr",4.23`,3.81`,3.93`,4.`,4.41`,5.85`,5.31`,3.26`,4.06`,5.5`,"-",73.51`}};

Programme (les données doivent se trouver dans la variable data1)

nom="Abel";
Mean[Select[data1[[Position[data1,nom][[1,1]]]],#<=6&]]