Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2003
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2003

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

Search the Archive

Re: a little more complex list operation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg40269] Re: a little more complex list operation
  • From: bobhanlon at aol.com (Bob Hanlon)
  • Date: Fri, 28 Mar 2003 04:32:58 -0500 (EST)
  • References: <b5uoth$lks$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Pick one:

data /. {x_, y_} :> {f[x], g[y]}

{f[#[[1]]],g[#[[2]]]}& /@ data

Inner[#1[#2]&, {f,g},#, List]& /@ data

MapThread[{f[#1],g[#2]}&,Transpose[data]]


Bob Hanlon

In article <b5uoth$lks$1 at smc.vnet.net>, Nathan Moore <nmoore at physics.umn.edu>
wrote:

<< 
Subject:	a little more complex list operation
From:		Nathan Moore <nmoore at physics.umn.edu>
To: mathgroup at smc.vnet.net
Date:		Thu, 27 Mar 2003 11:56:33 +0000 (UTC)

Thanks very much for all the previous replies.  Another simple question -
though I guess this will require more complex syntax.  Suppose I have the
list,

data = {{x1,y1},{x2,y2},{x3,y3}}

and I want to produce the result (for fitting/plotting)

data2 = {{f[x1],g[y1]},{f[x2],g[y2]},{f[x3],g[y3]}}

I assume that if there was only one transform I wanted to apply, f[x],
then I could say
	data2 = f[data]
but how about this more complicated transform with functions f and g?

again thanks!  Your replies have been very helpful!

Nathan Moore, University of Minnesota Physics







 >><BR><BR>


  • Prev by Date: Re: a little more complex list operation
  • Next by Date: Re: a little more complex list operation
  • Previous by thread: Re: a little more complex list operation
  • Next by thread: Re: a little more complex list operation