MathGroup Archive 2006

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

Search the Archive

Re: Remove Indeterminate elements

  • To: mathgroup at smc.vnet.net
  • Subject: [mg64307] Re: Remove Indeterminate elements
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Fri, 10 Feb 2006 02:13:55 -0500 (EST)
  • Organization: The Open University, Milton Keynes, UK
  • References: <dseti2$je8$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Baris Erbas wrote:
> Dear All,
> 
> I have been trying to remove some elements of a list which should be quite
> straightforward. The list is as follows:
> 
> {{x1,y1},{x2,y2},.{xi,yi},{Indeterminate,Indeterminate},.{xn,yn}}. All the
> components are real numbers apart from some Indeterminate expressions. I
> want the list without the Indeterminate terms. I have been trying to use
> Delete with If command but cannot succeed.
> 
> Can anyone help please?
> 
> Thanks
> 
Hi Baris,

You could try one of the following statements:

In[1]:=
lst = {{1., 2.}, {3, 4}, {5/3, -6},
     {Indeterminate, Indeterminate}, {E, Pi},
     {"Indeterminate", "Indeterminate"},
     {2.727, 1.123*10^6}};

In[2]:=
Cases[lst, {_Real, _Real}]

Out[2]=
                            6
{{1., 2.}, {2.727, 1.123 10 }}

In[3]:=
Cases[lst, {_?NumberQ, _?NumberQ}]

Out[3]=
                     5                       6
{{1., 2.}, {3, 4}, {-, -6}, {2.727, 1.123 10 }}
                     3

In[4]:=
Cases[lst, {_?NumericQ, _?NumericQ}]

Out[4]=
                     5                                6
{{1., 2.}, {3, 4}, {-, -6}, {E, Pi}, {2.727, 1.123 10 }}
                     3

Best regards,
/J.M.


  • Prev by Date: Re: Poisson equation
  • Next by Date: text bounding box size
  • Previous by thread: Re: Remove Indeterminate elements
  • Next by thread: Re: Remove Indeterminate elements