컴퓨터/Python
pandas excel columns duplicate
풍경소리^^
2019. 6. 1. 06:47
https://github.com/codebasics/py/blob/master/pandas/4_read_write_to_excel/read_write_csv_excel.ipynb
pandas xlsx file
import pandas as pd
filepath='d:\data\hometax\\'
excel1=filepath+'data1.xlsx'
excel2=filepath+'data2.xlsx'
excel3=filepath+'data3.xlsx'
df1=pd.read_excel(excel1,skiprows=5)
df1.to_excel(filepath+'dataframe1.xlsx',index=None)
df2=pd.read_excel(excel2,skiprows=5)
df2.to_excel(filepath+'dataframe2.xlsx',index=None)
df3=pd.read_excel(excel3,skiprows=5)
df3['세액']=0
df3['품목세액']=0
# print(df3.columns)
df3.to_excel(filepath+'dataframe3.xlsx',columns=['작성일자', '승인번호', '발급일자', '전송일자', '공급자사업자등록번호', '종사업장번호', '상호', '대표자명',
'주소', '공급받는자사업자등록번호', '종사업장번호.1', '상호.1', '대표자명.1', '주소.1', '합계금액',
'공급가액', '세액', '전자세금계산서분류', '전자세금계산서종류', '발급유형', '비고', '영수/청구 구분', '공급자 이메일',
'공급받는자 이메일1', '공급받는자 이메일2', '품목일자', '품목명', '품목규격', '품목수량', '품목단가',
'품목공급가액', '품목세액', '품목비고'],index=None)