Remove duplicate rows in a Worksheet
Remove duplicate rows is one of Microsoft Excel’s many useful features. It allows users to remove duplicate rows in a Worksheet, you can pick which columns should be checked for duplicate information.
Aspose.Cells for Python via .NET provides the Cells.remove_duplicates() method for this purpose. You can also set startRow, startColumn, endRow, endColumn to pick up columns.
Following are the sample files which can be downloaded for testing this feature:
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") |