MathGroup Archive 2001

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

Search the Archive

Re:Extracting units from a list of values

  • To: mathgroup at
  • Subject: [mg27430] Re:Extracting units from a list of values
  • From: bghiggins at (Brian Higgins)
  • Date: Sun, 25 Feb 2001 20:55:34 -0500 (EST)
  • Organization: The Math Forum
  • References: <>
  • Sender: owner-wri-mathgroup at

My earlier post  does not transform integers>1 at level 1 in the list.
The following seems to be more general and does the required task

In[104]:=mylist2 = {3, 2*Pi, 3*E*Meter^2, (3.5*Meter^2)/s, Meter*Pi,
3/(Pi*s), 3.75,  Sqrt[3]/Sqrt[7]}

In[136]:=mylist3 = DeleteCases[(If[NumericQ[#1], 1, #1] & ) /@
mylist2, _?NumericQ, {2}]

Out[136]={1, 1, Meter^2, Meter^2/s, Meter, 1/s, 1, 1}

and then a list of the numerical values is


Out[137]={3, 2*Pi, 3*E, 3.5, Pi, 3/Pi, 3.75, Sqrt[3/7]}.


  • Prev by Date: Re: Summation without Mathematica
  • Next by Date: Re: Deriviation d/dt(x(t))
  • Previous by thread: RE: Extracting units from a list of values
  • Next by thread: Hydrodybnamics of liquid and gas