Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas
- import numpy
- inputPandas = pandas.read_excel (r'C:\Users\DELL 5470\Desktop\Classeur1.xlsx',sheet_name='Feuil2')
- inputList= inputPandas.values.tolist()
- outputList = numpy.zeros((len(inputList), 4))
- outputList = outputList.tolist()
- for iLoop in range(0, len(inputList)):
- for jLoop in range(0, len(inputList[0])):
- inputList [iLoop][jLoop]= str(inputList[iLoop][jLoop])
- for iLoop in range(0, len(inputList)):
- for jLoop in range(0, len(inputList[0])-2):
- outputList [iLoop][jLoop]= str(outputList[iLoop][jLoop])
- for iLoop in range(0, len(inputList)):
- if inputList[iLoop][0]=='':
- outputList[iLoop][0]==''
- outputList[iLoop][1]==''
- else :
- outputList[iLoop][0]=inputList[iLoop][0][0:9]
- outputList[iLoop][1]=inputList[iLoop][0][10:]
- outputList[iLoop][2]=inputList[iLoop][3]
- outputList[iLoop][3]=inputList[iLoop][4]
- outputPandas = pandas.DataFrame(outputList)
- outputPandas.to_excel("output.xlsx")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement