Select
Select[data,critprop]
returns the property prop of the selected elements.
更多信息
- Select keeps the elements for which the given criterion crit is True.
- The data can have the following additional forms and interpretations:
-
{e1,e2,…} list of values » f[e1,e2,…] expression with any head f » Association[…] association of values » QuantityArray[…] quantity array or other structured array Tabular[…] type-consistent tabular data » TabularColumn[…] type-consistent column data » Dataset[…] general hierarchical data - The property prop can have the following forms and interpretations:
-
"Element" the selected values » "Index" indices of the selected values » "BitVectorMask" Boolean mask returning True for slected values and False otherwise » {prop1,prop2,…} a list of multiple forms » All an association giving element, index and bit vector mask » - Select[crit][data] is equivalent to Select[data,crit].
- Parallelize[Select[data,crit]] or ParallelSelect[data,crit] computes Select[data,crit] in parallel on all subkernels. »
范例
打开所有单元关闭所有单元基本范例 (6)
Return the indices of the selected elements:
Return only the first expression selected:
Use the operator form of Select:
Select operates on values in an Association:
Select rows in a Tabular object:
范围 (15)
Basic Uses (5)
Find up to 2 pairs containing x:
Fewer than the requested elements may be returned:
Use a pure function to test each element:
Use an operator form as selection criterion:
Use Select in operator form:
Input Data (5)
Select works with any head, not just List:
Select works on values in Association:
Select works with SparseArray objects:
The result may be a list if it is not sparse:
Select works with TabularColumn objects:
The distribution of the dates is uniform:
应用 (7)
属性和关系 (4)
文本
Wolfram Research (1988),Select,Wolfram 语言函数,https://reference.wolfram.com/language/ref/Select.html (更新于 2025 年).
CMS
Wolfram 语言. 1988. "Select." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2025. https://reference.wolfram.com/language/ref/Select.html.
APA
Wolfram 语言. (1988). Select. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/Select.html 年