MathGroup Archive 2006

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

Search the Archive

Re: how to compact many maps?


data = Table[{Random[], Random[]}, {10}, {5}];

d0 = ((MapAt[f, #1, 2] & ) /@ #1 & ) /@ data;

d1 = Table[{data[[i,j,1]], f[data[[i,j,2]]]}, {i, 1,
Dimensions[data][[1]]},
{j, 1, Dimensions[data][[2]]}];

d2 = data /. {x_Real, y_Real} -> {x, f[y]};

Dimensions /@ {data, d0, d1, d2}

{{10, 5, 2}, {10, 5, 2}, {10, 5, 2}, {10, 5, 2}}

d0 == d1 == d2

True

Regards
Dimitris


  • Prev by Date: Re: how to compact many maps?
  • Next by Date: Re: how to compact many maps?
  • Previous by thread: Re: how to compact many maps?
  • Next by thread: Re: how to compact many maps?