0% found this document useful (0 votes)
5 views1 page

Excel Data Cleaning and Sorting Script

This document discusses reading data from an Excel file into a Pandas dataframe, sorting columns, and writing the sorted data back to a new Excel file.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Excel Data Cleaning and Sorting Script

This document discusses reading data from an Excel file into a Pandas dataframe, sorting columns, and writing the sorted data back to a new Excel file.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd

df = pd.

ExcelFile(filename)

writer = ExcelWriter(outname)
sheet_names_list=list(df.sheet_names)
for sheets in sheet_names_list[-3:]:
df1 = pd.read_excel(filename, sheet_name=sheets)
rf=list([Link]);
rm=[]
for r in rf:
if [Link]('Unnamed:') >=0:
[Link](r)

for r in rm:
[Link](r)

wf1 = [Link](rf)
for rows in rf:
mylist = list(df1[rows].tolist())
mylist1=sorting(mylist)
wf1[rows]=mylist1
wf = [Link](wf1)
wf.to_excel(writer, sheet_name=sheets, index=False)
[Link]()

filename='/home/smundlamuri/Downloads/[Link]'
outname='/home/smundlamuri/Downloads/re_siva.xlsx'

You might also like