Building up on the solution proposed here : Simplifying nested If statements
You can find here the data set : allGazes.dat
allGazesX =
Uncompress@
Import[FileNameJoin[{NotebookDirectory[], "allGazes.dat.gz"}],
"String"];
I need to filter large data set and believe I lack an efficient method to do so. The purpose here is to filter given the EuclideanDistance[] between gazes. Below is what I am using currently :
This is what i am using currently :
GZ[delta_] := ParallelTable[
Table[
Reap[z = allGazesX[[subNO, dispNo, 1, ;; 2]];Sow[z];
Scan[
If[
EuclideanDistance[#, z] > delta,
z = #;Sow[z]] &,
allGazesX[[subNO, dispNo, All, ;; 2]]]][[2, 1]],
{dispNo, Range[Length[allGazesX[[subNO]]]]}],
{subNO, Range[5]}];
ParallelTablefor bothdispNoandsubNO? – rcollyer Mar 2 '12 at 15:13TableandParallelTableaccept multiple iterator arguments, or should. So, you could writeParallelTable[..., {subNO, ...}, {dispNo, ...}]instead of nesting the secondTableinside. Note,dispNohas to go aftersubNOwhich it depends on. Does that clarify what I was asking? Or, do you still get an error message? – rcollyer Mar 2 '12 at 16:53TableinsideParallelTablemay make sense, if you want to force certain (coarse) granularity of your computations. – Leonid Shifrin Mar 2 '12 at 17:57