DeleteAdjacentDuplicates

DeleteAdjacentDuplicates[list]

删除 list 中相同元素的所有重复项.

DeleteAdjacentDuplicates[list,test]

对成对的连续元素应用 test 以确定它们是否应被视为重复元素.

更多信息

范例

打开所有单元关闭所有单元

基本范例  (3)

删除相邻的重复元素:

删除在 Equal 下重合的相邻元素:

删除关联中其值与之前的值重复的元素:

范围  (2)

删除元素,除非它们大于前面的元素:

DeleteAdjacentDuplicates[list] 中,list 可以是任何非原子表达式:

属性和关系  (2)

DeleteAdjacentDuplicates 与从 Split 中获取每个项的第一个类似:

删除总和相同的子列表:

使用 SplitBy 也可以实现等效操作:

Wolfram Research (2022),DeleteAdjacentDuplicates,Wolfram 语言函数,https://reference.wolfram.com/language/ref/DeleteAdjacentDuplicates.html.

文本

Wolfram Research (2022),DeleteAdjacentDuplicates,Wolfram 语言函数,https://reference.wolfram.com/language/ref/DeleteAdjacentDuplicates.html.

CMS

Wolfram 语言. 2022. "DeleteAdjacentDuplicates." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/DeleteAdjacentDuplicates.html.

APA

Wolfram 语言. (2022). DeleteAdjacentDuplicates. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/DeleteAdjacentDuplicates.html 年

BibTeX

@misc{reference.wolfram_2024_deleteadjacentduplicates, author="Wolfram Research", title="{DeleteAdjacentDuplicates}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/DeleteAdjacentDuplicates.html}", note=[Accessed: 24-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_deleteadjacentduplicates, organization={Wolfram Research}, title={DeleteAdjacentDuplicates}, year={2022}, url={https://reference.wolfram.com/language/ref/DeleteAdjacentDuplicates.html}, note=[Accessed: 24-November-2024 ]}