Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Text-processing-1/Mathematica/text-processing-1.math
Normal file
15
Task/Text-processing-1/Mathematica/text-processing-1.math
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
FileName = "Readings.txt"; data = Import[FileName,"TSV"];
|
||||
Scan[(a=Position[#[[3;;All;;2]],1];
|
||||
Print["Line:",#[[1]] ,"\tReject:", 24 - Length[a], "\t Accept:", Length[a], "\tLine_tot:",
|
||||
Total@Part[#, Flatten[2*a]] , "\tLine_avg:", Total@Part[#, Flatten[2*a]]/Length[a]])&, data]
|
||||
|
||||
GlobalSum = Nb = Running = MaxRunRecorded = 0; MaxRunTime = {};
|
||||
Scan[ For[i = 3, i < 50, i = i + 2,
|
||||
If[#[[i]] == 1,
|
||||
Running=0; GlobalSum += #[[i-1]]; Nb++;,
|
||||
Running ++; If[MaxRunRecorded < Running, MaxRunRecorded = Running;MaxRunTime={ #[[1]]}; ];
|
||||
]] &, data ]
|
||||
|
||||
Print["\nFile(s) : ",FileName,"\nTotal : ",AccountingForm@GlobalSum,"\nReadings : ",Nb,
|
||||
"\nAverage : ",GlobalSum/Nb,"\n\nMaximum run(s) of ",MaxRunRecorded,
|
||||
" consecutive false readings ends at line starting with date(s):",MaxRunTime]
|
||||
Loading…
Add table
Add a link
Reference in a new issue