Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Another question on lists

  • To: mathgroup at smc.vnet.net
  • Subject: [mg80643] Re: [mg80618] Another question on lists
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Tue, 28 Aug 2007 02:04:48 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

aList = {{a, b, c}, Range[5], {1, a, 2, b, 3, c}, {1, 2}};

Select[aList, Length[#] == Max[Length /@ aList] &]

{{1, a, 2, b, 3, c}}

Select[aList, Length[#] == Min[Length /@ aList] &]

{{1, 2}}


Bob Hanlon

---- Mauricio Esteban Cuak <cuak2000 at gmail.com> wrote: 
> Hello again.Thank you very much for your previous help. However, I
> seem to stumble on another rock:
> 
> I  have a list of n sub-lists with different number of elements. I
> want to select the list with the highest number of elements.
> I tried to combine the Select function with Lenght but couldn't do it:
> 
> Select[list, Length /@ list >= Max[Length /@ list] &]
> 
> Thanks for reading.
> 
> Regards,
> 
> cd
> 
> P.D.: Any tips,websites, books, on how to learn some basic programming
> on Mathematica?
> I'm slowly beginning to read "The Mathematica Book"...should I just
> concentrate on that?
> 



  • Prev by Date: Re: Another question on lists
  • Next by Date: Re: Plot "not working"
  • Previous by thread: Re: Re: Re: Another question on lists
  • Next by thread: Re: Another question on lists