Hello!
I'm trying to process an Excel data set (attached) about fishing, with 27 heterogeneous variables... It seemed natural to use SemanticImport for that.
Notice I want (first) to split the data in function of the character "nom_sp" (name of the species catched).
ClearAll["Global`*"];
Place = NotebookDirectory[];
SetDirectory[Place <> "/Données"];
(*Brut=Flatten[Import["Peches2005.xlsx"],1];
EspècesP=DeleteDuplicates@Rest@Flatten@Take[Transpose@Brut,{-5}];
CodesVar=First@Brut;
Donnees=Dataset[Brut];
Trouve=GroupBy[Donnees,#[[Flatten@Position[CodesVar,VarInteret]]]&]*)
Donnees = SemanticImport["Peches2005.xlsx"]
VarInteret = "nom_sp";
Trouve = GroupBy[Donnees, VarInteret]
Seems to work fine, except that the dates are not correctly imported : "DateObject[{2002, 8, 14, 0, 0, 0.}, \"\"Instant\"\", \"\"Gregorian\"\ \", 1.]", for instance. Now, I try to extract data associated with the trout, coded "TRF".
Cherche = "TRF";
EspècesP = DeleteDuplicates@Donnees[All, VarInteret];
CodesTrouve = Flatten@Position[EspècesP, Cherche];
LePoisson = Trouve[CodesTrouve];
Print@%
It seems correct (except for the dates and hours...) but I cannot extract a column from this Dataset object :
LePoisson[All, "Total"]
LePoisson[4]
are wrong.
What should I do to obtain a proper dataset, with proper dates and hours?
Claude
Attachments: