MathGroup Archive 2006

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

Search the Archive

Re: List Help Needed

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68863] Re: List Help Needed
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Mon, 21 Aug 2006 06:33:18 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <ecbo4l$r5j$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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