python 3.x - Pandas XLSXwriter: open XLSX file and save with format -
problem description
excelwriter
pandas capable of storing xlsx files defined formats, possible capture formats , keep them datafile well? so;
- open xlsx file , capture number/time/date/.. formats; then
- save file same formats, example number, dates , time formats.
examples of storing number formats can found here, , storing date , time formats can found here.
mwe
1 - open xlsx file , capture formats
import pandas pd datetime import datetime # capture number/time/date/.. formats here? df = pandas.read_excel("sourcefile.xlsx")
2 - save xlsx file same formats
writer = pd.excelwriter("targetfile.xlsx", engine='xlsxwriter') df.to_excel(writer, sheet_name='sheet1') # set captured formats here writer.save()
Comments
Post a Comment