TakeDrop
詳細
- TakeDropは,標準的な列指定を使う.
-
All 全要素 None 要素なし n 1から n までの要素 UpTo[n] 可能な場合,1から最大で n までの要素 -n 最後の n 要素 {n} 要素 n のみ {m,n} m から n までの要素(両端を含む) {m,n,s} m から n までの要素をステップ s で - TakeDropは任意の頭部を持つ要素に使うことができる.頭部が Listである必要はない.
- TakeDropをSparseArrayオブジェクトに適用すると,通常はSparseArrayオブジェクトのペアが返される.
- TakeDropをAssociationオブジェクトに適用すると,通常は指定の位置にある要素を含むAssociationオブジェクトのペアが返される.
例題
すべて開く すべて閉じる例 (2)
スコープ (5)
TakeDropは標準的な列指定を使う:
TakeDrop[{a, b, c, d, e, f, g}, 3]TakeDrop[{a, b, c, d, e, f, g}, -3]TakeDrop[{a, b, c, d, e, f, g}, {3}]TakeDrop[{a, b, c, d, e, f, g}, {2, 4}]TakeDrop[{a, b, c, d, e, f, g}, {2, 6, 2}]TakeDrop[{a, b, c, d, e, f, g}, All]TakeDrop[{a, b, c, d, e, f, g}, None]最初のリストから要素を8つまで(あるいはできるだけたくさん)取る:
TakeDrop[{a, b, c, d, e, f, g}, UpTo[8]]TakeDrop[h[a, b, c, d, e, f, g], 3]TakeDropを疎配列に使う:
TakeDrop[SparseArray[{2 -> a, 7 -> b}, 10], 4]TakeDropを連想に使う:
TakeDrop[<|a -> α, b -> β, c -> γ, d -> δ, e -> ϵ|>, 2]アプリケーション (1)
テキスト
Wolfram Research (2015), TakeDrop, Wolfram言語関数, https://reference.wolfram.com/language/ref/TakeDrop.html (2015年に更新).
CMS
Wolfram Language. 2015. "TakeDrop." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/TakeDrop.html.
APA
Wolfram Language. (2015). TakeDrop. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TakeDrop.html
BibTeX
@misc{reference.wolfram_2026_takedrop, author="Wolfram Research", title="{TakeDrop}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/TakeDrop.html}", note=[Accessed: 20-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_takedrop, organization={Wolfram Research}, title={TakeDrop}, year={2015}, url={https://reference.wolfram.com/language/ref/TakeDrop.html}, note=[Accessed: 20-June-2026]}