Re: proper way to manipulate lists?
- To: mathgroup at smc.vnet.net
- Subject: [mg40207] Re: [mg40182] proper way to manipulate lists?
- From: Tomas Garza <tgarza01 at prodigy.net.mx>
- Date: Tue, 25 Mar 2003 14:51:11 -0500 (EST)
- References: <200303250804.DAA08362@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Look in the Help Browser for Inner. Example: In[1]:= data = {{x, u}, {y, v}, {z, w}}; In[2]:= Inner[Times, data, {a, b}, List] Out[2]= {{a*x, b*u}, {a*y, b*v}, {a*z, b*w}} Tomas Garza Mexico City ----- Original Message ----- From: "Nathan Moore" <nmoore at physics.umn.edu> To: mathgroup at smc.vnet.net Subject: [mg40207] [mg40182] proper way to manipulate lists? > > I'm sure this is a one-liner, but it has stumped me for years. Suppose > I'm working with a 2-d array of data, > data = {{x1,y1},{x2,y2}...{xN,yN}}; > and I want to transform the data according to, > data2 = {{x1*a,y1*b},{x2*a,y2*b}...{xN*a,yN*b}}; > The only way I know to do this is to move the data to excel, > performing the transform and then move the data back to Mathematica. This > is crazy - there must be a better way - is there? Please tell me there > is! > > regards, > > Nathan Moore, University of Minnesota Physics Department > > >
- References:
- proper way to manipulate lists?
- From: Nathan Moore <nmoore@physics.umn.edu>
- proper way to manipulate lists?