|
SOLUTIONS
|
MATHEMATICA 内置符号
GatherBy
GatherBy[list, f]
当应用 f,将 list 中每个集合中给出相同值的元素收集到子列表中.
GatherBy[list, {f1, f2, ...}]
在层 i 应用
后,将 list 收集到嵌套列表中.
更多信息更多信息
- GatherBy[{e1, e2, e3, ...}, f] 计算
,对于每个 i 确定如何收集
. - GatherBy[list, ...] 按照 list 中元素的顺序给出结果.
- 在 GatherBy[list, ...] 生成的每个子列表中, 元素的顺序和 list 中相同;对完整的子列表排序,这样第一个元素出现的顺序和 list 相同.
- GatherBy[list] 等价于 GatherBy[list, Identity],其中它也等价于 Gather[list]. »
- GatherBy 实际上产生一个等价的划分.
- GatherBy[list, {f1, f2}] 等价于 Map[GatherBy[#, f2]&, GatherBy[list, f1]].
版本 7 的新功能
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »

