Re: How to remove the Null character in a Table?
- To: mathgroup at smc.vnet.net
- Subject: [mg124353] Re: How to remove the Null character in a Table?
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Tue, 17 Jan 2012 03:31:27 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
On 1/16/12 at 5:11 PM, aoirex at gmail.com (Rex) wrote: >For example, >Table[If[i < 3, i,], {i, 5}] will give {1, 2, Null, Null, Null} >But I want the result to be {1,2}. >Any trick for this? It is trivial to filter the Null. For example: In[5]:= Cases[Table[If[i < 3, i], {i, 5}], _?NumericQ] Out[5]= {1,2} or simply use code that doesn't generate a Null, i.e., In[6]:= Cases[Range[5], _?(# < 3 &)] Out[6]= {1,2}