MathGroup Archive 2006

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

Search the Archive

Re: List Help Needed


Nimrod wrote:
> What combination of Map, MapAt, ...
> 
> will transform {{a,b},{c,d},...} to {{a,f[b]},{c,f[d]},...}

lst = {{a, b}, {c, d}, {e, f}};

lst /. {x_, y_} -> {x, f[y]}

--> {{a, f[b]}, {c, f[d]}, {e, f[f]}}

({#1[[1]], f[#1[[2]]]} & ) /@ lst

--> {{a, f[b]}, {c, f[d]}, {e, f[f]}}

HTH,
Jean-Marc


  • Prev by Date: Re: List Help Needed
  • Next by Date: Re: List Help Needed
  • Previous by thread: Re: List Help Needed
  • Next by thread: Re: Re: List Help Needed