Re: ReplacePart -> eliminate
- To: mathgroup at smc.vnet.net
- Subject: [mg131664] Re: ReplacePart -> eliminate
- From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
- Date: Tue, 17 Sep 2013 21:35:53 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
I'd like to eliminate the Indeterminate (or other non-numerical terms, as Infinite, etc...) items. Es. x = {-1.25664, 0.628319, -0.628319, 1.25664, Indeterminate, -1.25664, 0.628319, -0.628319, 1.25664, Indeterminate}; or x=Table[1/(3 - n), {n, 0, 5}]) {1/3, 1/2, 1, ComplexInfinity, -1,-1/2} How can I do it with a simple command? Many thanks, Roberto Hi, Roberto, Try this: x = {-1.25664, 0.628319, -0.628319, 1.25664, Indeterminate, -1.25664, 0.628319, -0.628319, 1.25664, Indeterminate}; y = Table[1/(3 - n), {n, 0, 5}]; Select[x, NumberQ[#] &] Select[y, NumberQ[#] &] {-1.25664, 0.628319, -0.628319, 1.25664, -1.25664, 0.628319, \ -0.628319, 1.25664} {1/3, 1/2, 1, -1, -(1/2)} Have fun, Alexei Alexei BOULBITCH, Dr., habil. IEE S.A. ZAE Weiergewan, 11, rue Edmond Reuter, L-5326 Contern, LUXEMBOURG Office phone : +352-2454-2566 Office fax: +352-2454-3566 mobile phone: +49 151 52 40 66 44 e-mail: alexei.boulbitch at iee.lu