Counts
例題
すべて開く すべて閉じる例 (2)
スコープ (1)
特性と関係 (6)
Counts[list]は要素を list に最初に現れた順にリストする:
Counts[{c, a, c}]Counts[list,elems]は要素を elems に最初に現れた順にリストする:
Counts[{c, a, c}, {a, b, c}]Counts[list,elems]は elems に含まれるすべての要素の合計を,たとえそれが list には含まれていなくても,含む:
Counts[{a, b, c}, {d, e}]CountsBy[list,f]は,事実上,Counts[Map[f,list]]である:
list = RandomInteger[{-1, 1}, 100];
CountsBy[list, Abs] === Counts[Map[Abs, list]]特に,CountsBy[list,Identity]はCounts[list]に等しい:
CountsBy[list, Identity] === Counts[list]Counts[expr]はGroupBy[expr,Identity,Length]に等しい:
Counts[{a, b, c, a}] == GroupBy[{a, b, c, a}, Identity, Length]Countsはリテラルな値を調べる:
list = {a, b, c, b, c, a, b};
Counts[list, {a, b, a | b}]Countはパターンにマッチする要素を合計する:
Count[list, a | b]関連するガイド
-
▪
- 連想 ▪
- 構造化されたデータ集合の計算 ▪
- リストへの数学的およびカウント操作 ▪
- データ集合に対するデータベース様の操作 ▪
- リスト操作 ▪
- 科学的データ解析 ▪
- 言語学データ ▪
- データの配列の操作
テキスト
Wolfram Research (2014), Counts, Wolfram言語関数, https://reference.wolfram.com/language/ref/Counts.html (2025年に更新).
CMS
Wolfram Language. 2014. "Counts." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/Counts.html.
APA
Wolfram Language. (2014). Counts. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Counts.html
BibTeX
@misc{reference.wolfram_2026_counts, author="Wolfram Research", title="{Counts}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/Counts.html}", note=[Accessed: 04-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_counts, organization={Wolfram Research}, title={Counts}, year={2025}, url={https://reference.wolfram.com/language/ref/Counts.html}, note=[Accessed: 04-September-2026]}