MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: For to Map to Increase Speed


Benedetto Bongiorno wrote:
> Is there a Map routine that can shorten the computation time of data
to
> data02?
>
> The variable data is a list of 1036 lists within which are lists of
> sublists of 1 or more, usually more.
>
> I cannot flatten data because I need to keep the groupings (1036)
that was
> created by Split.
>
> Dimensions[data]
>
> {1036}
>
> data02={};
>
> n=Length[data]+1;
>
> For[i=1,i<n,i++,step1=Mean[ColumnTake[data[[i]],{4,21}]];
>
> AppendTo[data02,Join[data[[i,1,{1,2}]],step1]]]
>
> Dimensions[data02]
>
> {1036,20}
> 


data02 = Join[#[[1,{1,2}]],Mean@ColumnTake[#,{4,21}]]& /@ data


  • Prev by Date: Re: direct product of two sets
  • Next by Date: Re: direct product of two sets
  • Previous by thread: Re: For to Map to Increase Speed
  • Next by thread: Partial evaulation of function terms