Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5795 > unrolled thread
| Started by | Heike Gramberg <heike.gramberg@gmail.com> |
|---|---|
| First post | 2011-10-22 10:18 +0000 |
| Last post | 2011-10-22 10:18 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: count the number of sub-list in a list Heike Gramberg <heike.gramberg@gmail.com> - 2011-10-22 10:18 +0000
| From | Heike Gramberg <heike.gramberg@gmail.com> |
|---|---|
| Date | 2011-10-22 10:18 +0000 |
| Subject | Re: count the number of sub-list in a list |
| Message-ID | <j7u58u$m$1@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
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web