MathGroup Archive 1999

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

Search the Archive

Q: Union and SameTest Option


Hi Mathematica-Groupers!

Can anybody explain to me what's going on here ? 

In[270]:=
Union[ {{a,b,1},{a,c,1},{x,y,2},{a,b,2}},
       SameTest->(#1[[2]]===#2[[2]]&) ]
Out[270]=
{{a,b,1},{a,c,1},{x,y,2}}

is ok since the first and the last list element have the same second
component. But what is wrong here now ?

In[272]:=
Union[ {{a,b,1},{a,c,1},{x,y,2},{a,b,2}},
       SameTest->(#1[[3]]===#2[[3]]&) ]
Out[272]=
{{a,b,1},{a,b,2},{a,c,1},{x,y,2}} 

Thanks in advance
Clemens

------------------------------------------------------------
Clemens Frey
Doctoral Student at the 
Department of Mathematics/BITOEK
University of Bayreuth(Germany)

clemens.frey at uni-bayreuth.de
http://www.bitoek.uni-bayreuth.de/~Clemens.Frey
------------------------------------------------------------



  • Prev by Date: rank of matrix in mathematica
  • Next by Date: Re: implementing a stack
  • Previous by thread: Re: rank of matrix in mathematica
  • Next by thread: Re: Q: Union and SameTest Option