Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

Re: count the number of sub-list in a list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg122260] Re: count the number of sub-list in a list
  • From: Heike Gramberg <heike.gramberg at gmail.com>
  • Date: Sat, 22 Oct 2011 06:09:37 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201110211128.HAA18658@smc.vnet.net>

You could do something like

Count[list, {Repeated[{Repeated[_?NumericQ, {3}]}, {3}]}, Infinity]

Heike.

On 21 Oct 2011, at 13:28, Gy Peng wrote:

> Dear All,
>
> I have a list like:
>
> {{{{-0.00201671, 0.87571, 0.482832}, {-0.839678,
>    0.260735, -0.476401}, {-0.543081, -0.406384,
>    0.734789}}, {{-0.87571, -0.00201671,
>    0.482832}, {-0.260735, -0.839678, -0.476401}, {0.406384, -0.543081,
> 0.734789}}, {{0.00201671, -0.87571,
>    0.482832}, {0.839678, -0.260735, -0.476401}, {0.543081, 0.406384,
>    0.734789}}, {{0.87571, 0.00201671, 0.482832}, {0.260735,
>    0.839678, -0.476401}, {-0.406384, 0.543081,
>    0.734789}}}, {{{0.839678, -0.260735, 0.476401}, {-0.00201671,
>    0.87571, 0.482832}, {-0.543081, -0.406384, 0.734789}}, {{0.260735,
>     0.839678, 0.476401}, {-0.87571, -0.00201671,
>    0.482832}, {0.406384, -0.543081, 0.734789}}, {{-0.839678,
>    0.260735, 0.476401}, {0.00201671, -0.87571, 0.482832}, {0.543081,
>    0.406384, 0.734789}}, {{-0.260735, -0.839678, 0.476401}, {0.87571,
>     0.00201671, 0.482832}, {-0.406384, 0.543081,
>    0.734789}}}, {{{0.00201671, -0.87571, -0.482832}, {0.839678, -0.260735,
> 0.476401}, {-0.543081, -0.406384, 0.734789}}, {{0.87571,
>    0.00201671, -0.482832}, {0.260735, 0.839678,
>    0.476401}, {0.406384, -0.543081, 0.734789}}, {{-0.00201671,
>    0.87571, -0.482832}, {-0.839678, 0.260735, 0.476401}, {0.543081,
>    0.406384,
>    0.734789}}, {{-0.87571, -0.00201671, -0.482832}, {-0.260735, -0.839678,
> 0.476401}, {-0.406384, 0.543081, 0.734789}}}, {{{-0.839678,
>     0.260735, -0.476401}, {0.00201671, -0.87571, -0.482832}, {-0.543081,
> -0.406384,
>    0.734789}}, {{-0.260735, -0.839678, -0.476401}, {0.87571,
>    0.00201671, -0.482832}, {0.406384, -0.543081,
>    0.734789}}, {{0.839678, -0.260735, -0.476401}, {-0.00201671,
>    0.87571, -0.482832}, {0.543081, 0.406384, 0.734789}}, {{0.260735,
>    0.839678, -0.476401}, {-0.87571, -0.00201671, -0.482832}, {-0.406384,
> 0.543081, 0.734789}}}}
>
> I consider each of {{*, *, *}, {*, *, *}, {*,*,*}} is one single element, so
> how could I count how many element in the whole list? Thank you very much!
>
> G




  • Prev by Date: Re: can not understand the symbol or the equation for an integration result
  • Next by Date: Re: count the number of sub-list in a list
  • Previous by thread: count the number of sub-list in a list
  • Next by thread: Re: count the number of sub-list in a list