MathGroup Archive 2000

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

Search the Archive

Re: Newbie question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg25284] Re: Newbie question
  • From: leko at ix.netcom.com (J. Leko)
  • Date: Tue, 19 Sep 2000 03:45:09 -0400 (EDT)
  • References: <8q3dvc$kbb@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Jose,

Using rules you could do this:

In[157]:= data = {{x, y}, {x1, y1}, {x2, y2}, {x3, y3}}

Out[157]= {{x, y}, {x1, y1}, {x2, y2}, {x3, y3}}

In[158]:= data1 = data /. {x_, y_} -> {x, 1/y}

Out[158]= {{x, 1/y}, {x1, 1/y1}, {x2, 1/y2}, {x3, 1/y3}}

This uses the ReplaceAll (/.) command (see section 2.4.1 in The
Mathematica Book).

Regards,

J. Leko
University of Alabama in Huntsville

Please reply to leko*j at cspar.uah.edu

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


  • Prev by Date: Re: Limit of sequence
  • Next by Date: Re: 2D array to tab delimited file
  • Previous by thread: Re: Newbie question
  • Next by thread: Re: Newbie question