MathGroup Archive 2006

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

Search the Archive

Re: Selecting Lists Without Null Results


runsTable=Table[Random[],{5},{6}];

runsTable[[2,4]]=Null;
runsTable[[4,4]]=Null;

Length[Select[runsTable, #[[4]] == Null&]]

2

Length[Select[runsTable, ToString[#[[4]]] != "Null"&]]

3


Bob Hanlon

---- Gregory Lypny <gregory.lypny at videotron.ca> wrote: 
> 	I must be doing something wrong as usual.  How come I can select  
> list with elements that have the word Null in them as a result of a  
> computation, but I cannot exclude them?
> 
> I have an array called runsTable with 179 rows, and there are five  
> rows with Null in column 14.
> 
> So,
> 
> 	Length[Select[runsTable, #[[14]] == Null &]
> 
> returns 5.
> 
> But
> 
> 	Length[Select[runsTable, (#[[14]]¬ Null) &]]
> 
> returns 0 when it should return 174, that is, 179 minus 5.
> 
> 	Am I using the NOT operator incorrectly?
> 
> 	Regards,
> 
> 		Gregory
> 


  • Prev by Date: Re: Selecting Lists Without Null Results
  • Next by Date: Re: General--Transformation of coordinates(from carteseian to polar)
  • Previous by thread: Re: Selecting Lists Without Null Results
  • Next by thread: Re: Selecting Lists Without Null Results