Assume that the original excel has been sorted according to id:
import pandas as pd
table = pd.read_excel(r"....your file path")
rid = list(table['RevisionID'])
did = []
for i in range(len(table)-1):
if rid[i] == rid[i+1]:
did.append(i)
for i in did:
del table[i:i+1]
pd.to_excel(r'...new file path')
After execution, a new excel will be formed listing the content you want.
Research the xlrd library, or how to use python to modify .csv files (just convert .xlsx/.xls files into csv). There is also an openpyxl library, but it should not be able to merge as you require.
Assume that the original excel has been sorted according to
id
:After execution, a new excel will be formed listing the content you want.
You can consider converting it to a csv file, and then just open the file for processing
Reference material http://bbs.bathome.net/thread-39568-1-1....
Research the xlrd library, or how to use python to modify .csv files (just convert .xlsx/.xls files into csv). There is also an openpyxl library, but it should not be able to merge as you require.
Thought:
Use an array to record rows with the same ID, and then use another library to merge them