Re: Replace non-numeric values in a list
- To: mathgroup at smc.vnet.net
- Subject: [mg88778] Re: Replace non-numeric values in a list
- From: Steven Siew <stevensiew2 at gmail.com>
- Date: Fri, 16 May 2008 05:32:51 -0400 (EDT)
- References: <g0h825$mtr$1@smc.vnet.net>
On May 15, 9:50 pm, "Adel Elsabbagh" <aelsabb... at gmail.com> wrote: > Dear all, > > I have a list that contains numeric and non-numeric values > list = { a, 1, 2, b, 3}; > How can I replace non-numeric values with zeros? > Thanks! > > -- > Adel Elsabbaghhttp://www.svlab-asu.com/aelsabbagh.html newlist = Map[( If[NumericQ[#],#,0] &),list] list = newlist