Re: Newbie question

• To: mathgroup at smc.vnet.net
• Subject: [mg25309] Re: Newbie question
• From: dlkeith at my-deja.com
• Date: Tue, 19 Sep 2000 03:45:36 -0400 (EDT)
• References: <8q3dvc\$kbb@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```In article <8q3dvc\$kbb at smc.vnet.net>,
Jose M Lasso <jml at accessinter.net> wrote:
> Hi Mathgroup,
>
> I have some numerical data: data:={{x,y},{x1,y1},{x2,y2}....{xn,yn}},
> I want to transform the data like this:
> data1:={{x,1/y},{x1,1/y1},{x2,1/y2}....{xn,1/yn}}, how can I do this
> transformation? Thanx in advance. Regards
>
> Jose M Lasso
>

data1={#[[1]], 1/#[[2]]} & /@ data
is one way.

Notice that {#[[1]],1/#[[2]]}& is the pure function form of

invertPartTwo[lst_]:={lst[[1]],1/lst[[2]]}

which could also be written

invertPartTwo[{p1_,p2_}]:={p1,1/p2}

Regards,

David

Sent via Deja.com http://www.deja.com/

```

• Prev by Date: Re: Animate multiple listplots
• Next by Date: Re: powersum with a function with variable count of parameters
• Previous by thread: Re: Newbie question
• Next by thread: Re: Newbie question