在工作表中删除重复行
Contents
[
Hide
]
删除重复行是Microsoft Excel的众多有用功能之一。它允许用户删除工作表中的重复行,您可以选择应检查重复信息的列。
Aspose.Cells for Python via .NET 为此提供了 Cells.remove_duplicates() 方法。您还可以设置 startRow、startColumn、endRow、endColumn 以选择要获取的列。
以下是可以下载以进行此功能测试的样本文件:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aspose.cells import Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# Create workbook | |
book = Workbook("removeduplicates.xlsx") | |
# Remove Duplicate | |
book.worksheets[0].cells.remove_duplicates(0 , 0, 5, 3) | |
# Save result | |
book.save("removeduplicates-result.xlsx") |