BinLists
詳細
- BinListsは,値が実数に対応しない要素を削除する.
- 次のビン幅指定 binspec を使うことができる.
-
dx 幅 dx のビン » {xmin,xmax,dx} xminから xmaxまでの幅 dx のビン » {{b1,b2,…}} 区間[b1,b2), [b2,b3), … » xbins,ybins,… {{x1,y1,…},{x2,y2, …},…}として理解される多変量 data のビン指定 » - BinLists[data,dx]は,ビンの境界が最初のビンがCeiling[Min[data]-dx,dx]で始まり最後のビンがFloor[Max[data]+dx,dx]で終る dx の整数倍であると解釈する.
-
- BinLists[data]はBinLists[data,1]に等しい.
- BinLists[data,{xmin,xmax,dx}]の要素は,その値が
を満足する場合はビン i に入れられる. -
- BinLists[data,{xmin,xmax}]はBinLists[data,{xmin,xmax,1}]に等しい.
- BinLists[data,{{b1,b2,…}}]の要素は,その値が
を満足する場合はビン i に入れられる. -
- BinLists[data,{{b1,b2,…}}]の形では,それぞれの最後にある bi は-Infinityおよび+Infinityでもよい.
- biは,増加列を形成しない場合は自動的にBinListsによって保存される.
- data が長さ n の部分リストからなるときは n ビン指定が与えられなければならず,BinLists[data,…]は深さ n のリストの配列を返す.
- 要素は,もとのデータと同じ順序で各ビンに現れる.
- data は,以下の形式と解釈を持つことができる.
-
{x1,x2,…} 実数あるいは数量のリスト » {{x1,y1,…},{x2,y2,…},…} 同じ次元のベクトルのリスト » SparseArray Normal[data]に等しい配列 » QuantityArray 列と互換の数量の配列 » TimeSeries, TemporalData,… 値のベクトルまたは配列(タイムスタンプは無視される) » - 入力要素 xiの inds ラベルは以下の形式で与えることができる. »
-
{x1,x2,…} xiそれ自体を使う(デフォルトでラベルはない) {x1,x2,…}Automatic 整数ラベルを使う {x1,x2,…}{v1,v2,…} 全要素と全ラベル間の規則 {x1v1,x2v2,…} 要素 xiとそのラベル viの間の規則
例題
すべて開く すべて閉じる例 (3)
スコープ (12)
基本的な用法 (8)
data = Table[Mod[i ^ 2, {3, 5}], {i, 20}];
Dimensions[data]BinLists[data, 1, 1]data = RandomReal[{-1, 1}, {10, 2}];
Dimensions[data]BinLists[data, {-1, 1, .25}, {-1, 1, .25}]data = RandomReal[{-1, 1}, {10, 2}];BinLists[data, {{-2, .3, 2}}, {{-1, -.4, .2, 1}}]BinLists[RandomReal[{-1, 1}, {10, 4}]]BinLists[{1.5, 3, a, 2.5, 1, I}, 2]BinLists[{1.5, 3, N[3, 20], 2.5, 1, E}, 2]SparseArrayデータは密な配列と同じように使うことができる:
data = SparseArray[{{1, 1} -> 5, {3, 2} -> 4}, {30, 2}]BinLists[data]sp = SparseArray[{{i_, i_} :> i, {i_, j_} /; j == i + 1 :> i - 1}, {10, 3}, 3]BinLists[sp]ts = TemporalData[TimeSeries, {{{-0.8514215942160073, 0.498847153572056, -0.5117595526567502,
-0.1541269987967291, 0.21199829846035145, 0.7834143496676975, -0.16460155429334833,
0.8166857502105551, -0.662728145444706, -0.9440223497598601, 0.34 ... 0.12583411201016714}},
{TemporalData`DateSpecification[{2014, 2, 2, 0, 0, 0.}, {2014, 2, 14, 0, 0, 0.}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.1];BinLists[ts]BinLists[ts["Values"]]% == %%単位付きのデータ (3)
data = {Quantity[-1.541, "Grams"], Quantity[-0.849, "Grams"], Quantity[-0.477, "Grams"], Quantity[-0.133, "Grams"], Quantity[-0.11, "Grams"], Quantity[-0.054, "Grams"], Quantity[0.226, "Grams"], Quantity[0.259, "Grams"], Quantity[1.4, "Grams"], Quantity[1.661, "Grams"]};BinLists[data]BinLists[data, Quantity[.5, "Grams"]]BinLists[data, {Quantity[-1, "Grams"], Quantity[1, "Grams"], Quantity[.1, "Grams"]}]BinLists[data, {{Quantity[-2, "Grams"], Quantity[0, "Grams"], Quantity[2, "Grams"]}}]mat = RandomReal[10, {3, 3}];
mat[[All, 1]] *= Quantity["Meters"];
mat[[All, 3]] *= Quantity["Seconds"];mat//MatrixFormBinLists[mat, Quantity[2, "Meters"], 3, Quantity[1, "Seconds"]]QuantityArrayは配列と同じように使うことができる:
data = QuantityArray[RandomReal[1, 6], "Pounds"]BinLists[data]BinLists[data, Quantity[.2, "Kilograms"]]ラベル付きのデータ (1)
BinLists[{1.5, 3, 2.5, 1, E, 7} -> {"a", "b", "c", "d", "e", "f"}, 2]BinLists[{1.5 -> "a", 3 -> "b", 2.5 -> "c", 1 -> "d", E -> "e", 7 -> "f"}, 2]BinLists[{1.5, 3, 2.5, 1, E, 7} -> Automatic, 2]アプリケーション (1)
特性と関係 (1)
data = RandomReal[{-5, 5}, 1000];Map[Length, BinLists[data]]BinCounts[data]%% == %data2 = RandomReal[{-5, 5}, {1000, 2}];Map[Length, BinLists[data2], {2}] == BinCounts[data2]考えられる問題 (4)
BinLists[{1, 2, 3, 4, 5}]BinLists[{1 - $MachineEpsilon, 2, 3, 4, 5}]単位付きのデータの場合,ビン指定は互換単位で行わなければならない:
data = Quantity[RandomReal[1, 20], "Meters"];BinLists[data, .2]BinLists[data, Quantity[20, "Centimeters"]]mat = {{Quantity[1.03, "Meters"], Quantity[1.65, "Meters"], Quantity[1.49, "Meters"]}, {4.013, 3.40, 2.5}, {Quantity[3.9, "Seconds"], Quantity[1.88, "Seconds"], Quantity[3.52, "Seconds"]}};BinLists[mat]BinLists[Transpose@mat]指定{min,max,dx}を使って取得したビンは,すべてのデータ点を含まないかもしれない:
data = Range[1, 50];res1 = BinLists[data, {Min[data], Max[data], 10}]{Length[data], Total[Length /@ res1]}すべてのデータ点がビンの範囲に含まれるように min と max を指定する:
dx = 10;
min = 1;
max = min + dx * Ceiling[Length[data] / dx];res2 = BinLists[data, {min, max, dx}]Total[Length /@ res2]res3 = BinLists[data, 10]Total[Length /@ res3]関連するガイド
-
▪
- リストの要素 ▪
- 離散データと整数データ
テキスト
Wolfram Research (2007), BinLists, Wolfram言語関数, https://reference.wolfram.com/language/ref/BinLists.html (2024年に更新).
CMS
Wolfram Language. 2007. "BinLists." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/BinLists.html.
APA
Wolfram Language. (2007). BinLists. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BinLists.html
BibTeX
@misc{reference.wolfram_2026_binlists, author="Wolfram Research", title="{BinLists}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/BinLists.html}", note=[Accessed: 08-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_binlists, organization={Wolfram Research}, title={BinLists}, year={2024}, url={https://reference.wolfram.com/language/ref/BinLists.html}, note=[Accessed: 08-September-2026]}