SortBy
范例
打开所有单元 关闭所有单元基本范例 (4)
对 Association 中各元素的值取模 3,按所得结果进行排序:
使用算符形式的 SortBy:
范围 (8)
推广和延伸 (1)
SortBy 可用于具有任意标头的表达式:
应用 (3)
根据 LeafCount 排序:
属性和关系 (4)
Sort[list] 等价于 SortBy[list,Identity]:
SortBy[e,f] 等同于 Sort[{f[#],#}&/@e][[All,-1]]:
ReverseSortBy 使用反标准顺序排序:
ReverseSortBy[list,fs] 的结果不总是 Reverse[SortBy[list,fs]]:
SortBy[list,f] 等价于 list[[OrderingBy[list,f]]]:
文本
Wolfram Research (2007),SortBy,Wolfram 语言函数,https://reference.wolfram.com/language/ref/SortBy.html (更新于 2019 年).
CMS
Wolfram 语言. 2007. "SortBy." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2019. https://reference.wolfram.com/language/ref/SortBy.html.
APA
Wolfram 语言. (2007). SortBy. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/SortBy.html 年
BibTeX
@misc{reference.wolfram_2025_sortby, author="Wolfram Research", title="{SortBy}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/SortBy.html}", note=[Accessed: 05-October-2025]}
BibLaTeX
@online{reference.wolfram_2025_sortby, organization={Wolfram Research}, title={SortBy}, year={2019}, url={https://reference.wolfram.com/language/ref/SortBy.html}, note=[Accessed: 05-October-2025]}