CountsBy
例題
すべて開く すべて閉じる例 (2)
CountsBy[{1, 2, 3, 2, 1, 1}, EvenQ]CountsBy[Range[1000], PrimeQ]CountsByの演算子形を使う:
CountsBy[PrimeQ][Range[1000]]スコープ (1)
特性と関係 (3)
結果中の要素は,f[ei]の値がリストに最初に現れた順に現れる:
numbers = {0, 1, -1, I, -I, 1 + I, 1 - I, -1 + I, -1 + I}
CountsBy[numbers, Abs]CountsBy[Reverse[numbers], Abs]CountsBy[RotateLeft[numbers], Abs]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]CountsBy[expr,f]はGroupBy[expr,f,Length]に等しい:
CountsBy[{{a, b}, {b, c}, {a, d}}, First] == GroupBy[{{a, b}, {b, c}, {a, d}}, First, Length]関連するガイド
テキスト
Wolfram Research (2014), CountsBy, Wolfram言語関数, https://reference.wolfram.com/language/ref/CountsBy.html.
CMS
Wolfram Language. 2014. "CountsBy." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CountsBy.html.
APA
Wolfram Language. (2014). CountsBy. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CountsBy.html
BibTeX
@misc{reference.wolfram_2026_countsby, author="Wolfram Research", title="{CountsBy}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/CountsBy.html}", note=[Accessed: 16-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_countsby, organization={Wolfram Research}, title={CountsBy}, year={2014}, url={https://reference.wolfram.com/language/ref/CountsBy.html}, note=[Accessed: 16-September-2026]}